public class Mojangson extends Object
Modifier and Type | Method and Description |
---|---|
static String |
fromGenericTag(Tag tag)
Creates a Mojangson string from the given NBT Tag.
|
static String |
fromTag(ByteArrayTag tag)
Creates a Mojangson string from the given ByteArray Tag.
|
static String |
fromTag(ByteTag tag)
Creates a Mojangson string from the given Byte Tag.
|
static String |
fromTag(CompoundTag tag)
Creates a Mojangson string from the given Compound Tag.
|
static String |
fromTag(DoubleTag tag)
Creates a Mojangson string from the given Double Tag.
|
static String |
fromTag(FloatTag tag)
Creates a Mojangson string from the given Float Tag.
|
static String |
fromTag(IntArrayTag tag)
Creates a Mojangson string from the given IntArray Tag.
|
static String |
fromTag(IntTag tag)
Creates a Mojangson string from the given Int Tag.
|
static String |
fromTag(ListTag<Tag> tag)
Creates a Mojangson string from the given List Tag.
|
static String |
fromTag(LongTag tag)
Creates a Mojangson string from the given Long Tag.
|
static String |
fromTag(ShortTag tag)
Creates a Mojangson string from the given Short Tag.
|
static String |
fromTag(StringTag tag)
Creates a Mojangson string from the given String Tag.
|
static Tag |
parseArray(String mojangson)
Parses an Array value from a Mojangson string.
|
static ByteTag |
parseByte(String mojangson)
Parses a Byte value from a Mojangson string as an NBT ByteTag.
|
static CompoundTag |
parseCompound(String mojangson)
Parses a Compound from a Mojangson string as an NBT CompoundTag.
|
static DoubleTag |
parseDouble(String mojangson)
Parses a Double value from a Mojangson string as an NBT DoubleTag.
|
static FloatTag |
parseFloat(String mojangson)
Parses a Float value from a Mojangson string as an NBT FloatTag.
|
static IntTag |
parseInt(String mojangson)
Parses an Integer value from a Mojangson string as an NBT IntTag.
|
static LongTag |
parseLong(String mojangson)
Parses a Long value from a Mojangson string as an NBT LongTag.
|
static ShortTag |
parseShort(String mojangson)
Parses a Short value from a Mojangson string as an NBT ShortTag.
|
static StringTag |
parseString(String mojangson)
Parses an String value from a Mojangson string as an NBT StringTag.
|
static Tag |
parseTag(String mojangson)
Detects the Tag type of the Mojangson string, and parses it.
|
public static Tag parseTag(String mojangson) throws MojangsonParseException
This method will fall back to an IntTag if it could not find an appropriate Tag type, and to String if the value could not be parsed as an Integer either.
mojangson
- The Mojangson stringMojangsonParseException
- if the given Mojangson string could not be parsed.public static IntTag parseInt(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as an
Integer value.public static StringTag parseString(String mojangson)
mojangson
- The Mojangson stringpublic static LongTag parseLong(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a Long
value.public static DoubleTag parseDouble(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a
Double value.public static FloatTag parseFloat(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a
Flaot value.public static ShortTag parseShort(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a
Short value.public static ByteTag parseByte(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a Byte
value.public static CompoundTag parseCompound(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as a
Compound value.public static Tag parseArray(String mojangson) throws MojangsonParseException
mojangson
- The Mojangson stringMojangsonParseException
- if the Mojangson string could not be parsed as an
Array value.public static String fromGenericTag(Tag tag)
tag
- the NBT Tag to convertpublic static String fromTag(ByteTag tag)
tag
- the Byte Tag to convertpublic static String fromTag(ByteArrayTag tag)
tag
- the ByteArray Tag to convertpublic static String fromTag(CompoundTag tag)
tag
- the Compound Tag to convertpublic static String fromTag(DoubleTag tag)
tag
- the Double Tag to convertpublic static String fromTag(FloatTag tag)
tag
- the Float Tag to convertpublic static String fromTag(IntTag tag)
tag
- the Int Tag to convertpublic static String fromTag(IntArrayTag tag)
tag
- the IntArray Tag to convertpublic static String fromTag(ListTag<Tag> tag)
tag
- the List Tag to convertpublic static String fromTag(LongTag tag)
tag
- the Long Tag to convertpublic static String fromTag(ShortTag tag)
tag
- the Short Tag to convertCopyright © 2021. All rights reserved.