Package net.minecraft.nbt
Class NbtHelper
java.lang.Object
net.minecraft.nbt.NbtHelper
public final class NbtHelper extends Object
-
Field Summary
Fields Modifier and Type Field Description private static Comparator<ListTag>field_27816private static Comparator<ListTag>field_27817private static Splitterfield_27818private static Splitterfield_27819private static LoggerLOGGER -
Constructor Summary
Constructors Constructor Description NbtHelper() -
Method Summary
Modifier and Type Method Description static CompoundTagfromBlockPos(BlockPos pos)static CompoundTagfromBlockState(BlockState state)static CompoundTagfromGameProfile(CompoundTag tag, com.mojang.authlib.GameProfile profile)static IntArrayTagfromUuid(UUID uuid)Serializes aUUIDinto its equivalent NBT representation.static booleanmatches(Tag standard, Tag subject, boolean equalValue)static CompoundTagmethod_32260(String string)(package private) static CompoundTagmethod_32267(String string)(package private) static CompoundTagmethod_32273(CompoundTag tag)(package private) static CompoundTagmethod_32275(CompoundTag compoundTag)(package private) static Stringmethod_32277(CompoundTag compoundTag)private static <T extends Comparable<T>>
StringnameValue(Property<T> property, Comparable<?> value)static BlockPostoBlockPos(CompoundTag tag)static BlockStatetoBlockState(CompoundTag tag)static com.mojang.authlib.GameProfiletoGameProfile(CompoundTag tag)static StringtoPrettyPrintedString(CompoundTag tag)static TexttoPrettyPrintedText(Tag tag)static UUIDtoUuid(Tag tag)Deserializes a tag into aUUID.static CompoundTagupdate(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion)Uses the data fixer to update a tag to the latest data version.static CompoundTagupdate(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion, int targetVersion)Uses the data fixer to update a tag.private static <S extends State<?, S>, T extends Comparable<T>>
SwithProperty(S state, Property<T> property, String key, CompoundTag propertiesTag, CompoundTag mainTag)
-
Field Details
-
field_27816
-
field_27817
-
field_27818
-
field_27819
-
LOGGER
-
-
Constructor Details
-
NbtHelper
public NbtHelper()
-
-
Method Details
-
toGameProfile
-
fromGameProfile
-
matches
-
fromUuid
Serializes aUUIDinto its equivalent NBT representation.- Since:
- 20w10a
-
toUuid
Deserializes a tag into aUUID. The tag's data must have the same structure as the output offromUuid(java.util.UUID).- Throws:
IllegalArgumentException- iftagis not a valid representation of a UUID- Since:
- 20w10a
-
toBlockPos
-
fromBlockPos
-
toBlockState
-
withProperty
private static <S extends State<?, S>, T extends Comparable<T>> S withProperty(S state, Property<T> property, String key, CompoundTag propertiesTag, CompoundTag mainTag) -
fromBlockState
-
nameValue
private static <T extends Comparable<T>> String nameValue(Property<T> property, Comparable<?> value) -
update
public static CompoundTag update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion)Uses the data fixer to update a tag to the latest data version.- Parameters:
fixer- the data fixerfixTypes- the fix typestag- the tag to fixoldVersion- the data version of the compound tag
-
update
public static CompoundTag update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion, int targetVersion)Uses the data fixer to update a tag.- Parameters:
fixer- the data fixerfixTypes- the fix typestag- the tag to fixoldVersion- the data version of the compound tagtargetVersion- the data version to update the tag to
-
toPrettyPrintedText
-
toPrettyPrintedString
-
method_32260
public static CompoundTag method_32260(String string) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
method_32273
-
method_32275
-
method_32277
-
method_32267
-