Package net.minecraft.nbt
Class NbtHelper
java.lang.Object
net.minecraft.nbt.NbtHelper
public final class NbtHelper extends Object
- Mappings:
Namespace Name official ndintermediary net/minecraft/class_2512named net/minecraft/nbt/NbtHelper
-
Field Summary
Fields Modifier and Type Field Description private static SplitterCOMMA_SPLITTERprivate static Comparator<NbtList>field_27816private static Comparator<NbtList>field_27817private static Splitterfield_27819private static LoggerLOGGER -
Constructor Summary
Constructors Constructor Description NbtHelper() -
Method Summary
Modifier and Type Method Description static NbtCompoundfromBlockPos(BlockPos pos)static NbtCompoundfromBlockState(BlockState state)static NbtIntArrayfromUuid(UUID uuid)Serializes aUUIDinto its equivalent NBT representation.static booleanmatches(@Nullable NbtElement standard, @Nullable NbtElement subject, boolean equalValue)static NbtCompoundmethod_32260(String string)(package private) static NbtCompoundmethod_32267(String string)(package private) static NbtCompoundmethod_32273(NbtCompound compound)(package private) static NbtCompoundmethod_32275(NbtCompound compound)(package private) static Stringmethod_32277(NbtCompound compound)private static <T extends Comparable<T>>
StringnameValue(Property<T> property, Comparable<?> value)static BlockPostoBlockPos(NbtCompound compound)static BlockStatetoBlockState(NbtCompound compound)static @Nullable com.mojang.authlib.GameProfiletoGameProfile(NbtCompound compound)static StringtoPrettyPrintedString(NbtCompound compound)static TexttoPrettyPrintedText(NbtElement element)static UUIDtoUuid(NbtElement element)Deserializes an NBT element into aUUID.static NbtCompoundupdate(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, NbtCompound compound, int oldVersion)Uses the data fixer to update an NBT compound object to the latest data version.static NbtCompoundupdate(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, NbtCompound compound, int oldVersion, int targetVersion)Uses the data fixer to update an NBT compound object.private static <S extends State<?, S>, T extends Comparable<T>>
SwithProperty(S state, Property<T> property, String key, NbtCompound properties, NbtCompound root)static NbtCompoundwriteGameProfile(NbtCompound compound, com.mojang.authlib.GameProfile profile)
-
Field Details
-
field_27816
- Mappings:
Namespace Name Mixin selector official aLnd;a:Ljava/util/Comparator;intermediary field_27816Lnet/minecraft/class_2512;field_27816:Ljava/util/Comparator;named field_27816Lnet/minecraft/nbt/NbtHelper;field_27816:Ljava/util/Comparator;
-
field_27817
- Mappings:
Namespace Name Mixin selector official bLnd;b:Ljava/util/Comparator;intermediary field_27817Lnet/minecraft/class_2512;field_27817:Ljava/util/Comparator;named field_27817Lnet/minecraft/nbt/NbtHelper;field_27817:Ljava/util/Comparator;
-
COMMA_SPLITTER
- Mappings:
Namespace Name Mixin selector official cLnd;c:Lcom/google/common/base/Splitter;intermediary field_27818Lnet/minecraft/class_2512;field_27818:Lcom/google/common/base/Splitter;named COMMA_SPLITTERLnet/minecraft/nbt/NbtHelper;COMMA_SPLITTER:Lcom/google/common/base/Splitter;
-
field_27819
- Mappings:
Namespace Name Mixin selector official dLnd;d:Lcom/google/common/base/Splitter;intermediary field_27819Lnet/minecraft/class_2512;field_27819:Lcom/google/common/base/Splitter;named field_27819Lnet/minecraft/nbt/NbtHelper;field_27819:Lcom/google/common/base/Splitter;
-
LOGGER
- Mappings:
Namespace Name Mixin selector official eLnd;e:Lorg/apache/logging/log4j/Logger;intermediary field_11582Lnet/minecraft/class_2512;field_11582:Lorg/apache/logging/log4j/Logger;named LOGGERLnet/minecraft/nbt/NbtHelper;LOGGER:Lorg/apache/logging/log4j/Logger;
-
-
Constructor Details
-
NbtHelper
public NbtHelper()
-
-
Method Details
-
toGameProfile
@Nullable public static @Nullable com.mojang.authlib.GameProfile toGameProfile(NbtCompound compound)- Mappings:
Namespace Name Mixin selector official aLnd;a(Lmr;)Lcom/mojang/authlib/GameProfile;intermediary method_10683Lnet/minecraft/class_2512;method_10683(Lnet/minecraft/class_2487;)Lcom/mojang/authlib/GameProfile;named toGameProfileLnet/minecraft/nbt/NbtHelper;toGameProfile(Lnet/minecraft/nbt/NbtCompound;)Lcom/mojang/authlib/GameProfile;
-
writeGameProfile
public static NbtCompound writeGameProfile(NbtCompound compound, com.mojang.authlib.GameProfile profile)- Mappings:
Namespace Name Mixin selector official aLnd;a(Lmr;Lcom/mojang/authlib/GameProfile;)Lmr;intermediary method_10684Lnet/minecraft/class_2512;method_10684(Lnet/minecraft/class_2487;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/class_2487;named writeGameProfileLnet/minecraft/nbt/NbtHelper;writeGameProfile(Lnet/minecraft/nbt/NbtCompound;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/nbt/NbtCompound;
-
matches
public static boolean matches(@Nullable @Nullable NbtElement standard, @Nullable @Nullable NbtElement subject, boolean equalValue)- Mappings:
Namespace Name Mixin selector official aLnd;a(Lnj;Lnj;Z)Zintermediary method_10687Lnet/minecraft/class_2512;method_10687(Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;Z)Znamed matchesLnet/minecraft/nbt/NbtHelper;matches(Lnet/minecraft/nbt/NbtElement;Lnet/minecraft/nbt/NbtElement;Z)Z
-
fromUuid
Serializes aUUIDinto its equivalent NBT representation.- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official aLnd;a(Ljava/util/UUID;)Lmv;intermediary method_25929Lnet/minecraft/class_2512;method_25929(Ljava/util/UUID;)Lnet/minecraft/class_2495;named fromUuidLnet/minecraft/nbt/NbtHelper;fromUuid(Ljava/util/UUID;)Lnet/minecraft/nbt/NbtIntArray;
-
toUuid
Deserializes an NBT element into aUUID. The NBT element's data must have the same structure as the output offromUuid(java.util.UUID).- Throws:
IllegalArgumentException- ifelementis not a valid representation of a UUID- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official aLnd;a(Lnj;)Ljava/util/UUID;intermediary method_25930Lnet/minecraft/class_2512;method_25930(Lnet/minecraft/class_2520;)Ljava/util/UUID;named toUuidLnet/minecraft/nbt/NbtHelper;toUuid(Lnet/minecraft/nbt/NbtElement;)Ljava/util/UUID;
-
toBlockPos
- Mappings:
Namespace Name Mixin selector official bLnd;b(Lmr;)Lfx;intermediary method_10691Lnet/minecraft/class_2512;method_10691(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2338;named toBlockPosLnet/minecraft/nbt/NbtHelper;toBlockPos(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/util/math/BlockPos;
-
fromBlockPos
- Mappings:
Namespace Name Mixin selector official aLnd;a(Lfx;)Lmr;intermediary method_10692Lnet/minecraft/class_2512;method_10692(Lnet/minecraft/class_2338;)Lnet/minecraft/class_2487;named fromBlockPosLnet/minecraft/nbt/NbtHelper;fromBlockPos(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/nbt/NbtCompound;
-
toBlockState
- Mappings:
Namespace Name Mixin selector official cLnd;c(Lmr;)Lciz;intermediary method_10681Lnet/minecraft/class_2512;method_10681(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2680;named toBlockStateLnet/minecraft/nbt/NbtHelper;toBlockState(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/block/BlockState;
-
withProperty
private static <S extends State<?, S>, T extends Comparable<T>> S withProperty(S state, Property<T> property, String key, NbtCompound properties, NbtCompound root)- Mappings:
Namespace Name Mixin selector official aLnd;a(Lcjb;Lckc;Ljava/lang/String;Lmr;Lmr;)Lcjb;intermediary method_10682Lnet/minecraft/class_2512;method_10682(Lnet/minecraft/class_2688;Lnet/minecraft/class_2769;Ljava/lang/String;Lnet/minecraft/class_2487;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2688;named withPropertyLnet/minecraft/nbt/NbtHelper;withProperty(Lnet/minecraft/state/State;Lnet/minecraft/state/property/Property;Ljava/lang/String;Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/state/State;
-
fromBlockState
- Mappings:
Namespace Name Mixin selector official aLnd;a(Lciz;)Lmr;intermediary method_10686Lnet/minecraft/class_2512;method_10686(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2487;named fromBlockStateLnet/minecraft/nbt/NbtHelper;fromBlockState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/nbt/NbtCompound;
-
nameValue
private static <T extends Comparable<T>> String nameValue(Property<T> property, Comparable<?> value)- Mappings:
Namespace Name Mixin selector official aLnd;a(Lckc;Ljava/lang/Comparable;)Ljava/lang/String;intermediary method_10685Lnet/minecraft/class_2512;method_10685(Lnet/minecraft/class_2769;Ljava/lang/Comparable;)Ljava/lang/String;named nameValueLnet/minecraft/nbt/NbtHelper;nameValue(Lnet/minecraft/state/property/Property;Ljava/lang/Comparable;)Ljava/lang/String;
-
update
public static NbtCompound update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, NbtCompound compound, int oldVersion)Uses the data fixer to update an NBT compound object to the latest data version.- Parameters:
fixer- the data fixerfixTypes- the fix typescompound- the NBT compound object to fixoldVersion- the data version of the NBT compound object- Mappings:
Namespace Name Mixin selector official aLnd;a(Lcom/mojang/datafixers/DataFixer;Lahm;Lmr;I)Lmr;intermediary method_10688Lnet/minecraft/class_2512;method_10688(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;I)Lnet/minecraft/class_2487;named updateLnet/minecraft/nbt/NbtHelper;update(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/datafixer/DataFixTypes;Lnet/minecraft/nbt/NbtCompound;I)Lnet/minecraft/nbt/NbtCompound;
-
update
public static NbtCompound update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, NbtCompound compound, int oldVersion, int targetVersion)Uses the data fixer to update an NBT compound object.- Parameters:
fixer- the data fixerfixTypes- the fix typescompound- the NBT compound object to fixoldVersion- the data version of the NBT compound objecttargetVersion- the data version to update the NBT compound object to- Mappings:
Namespace Name Mixin selector official aLnd;a(Lcom/mojang/datafixers/DataFixer;Lahm;Lmr;II)Lmr;intermediary method_10693Lnet/minecraft/class_2512;method_10693(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;II)Lnet/minecraft/class_2487;named updateLnet/minecraft/nbt/NbtHelper;update(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/datafixer/DataFixTypes;Lnet/minecraft/nbt/NbtCompound;II)Lnet/minecraft/nbt/NbtCompound;
-
toPrettyPrintedText
- Mappings:
Namespace Name Mixin selector official cLnd;c(Lnj;)Loj;intermediary method_32270Lnet/minecraft/class_2512;method_32270(Lnet/minecraft/class_2520;)Lnet/minecraft/class_2561;named toPrettyPrintedTextLnet/minecraft/nbt/NbtHelper;toPrettyPrintedText(Lnet/minecraft/nbt/NbtElement;)Lnet/minecraft/text/Text;
-
toPrettyPrintedString
- Mappings:
Namespace Name Mixin selector official dLnd;d(Lmr;)Ljava/lang/String;intermediary method_32271Lnet/minecraft/class_2512;method_32271(Lnet/minecraft/class_2487;)Ljava/lang/String;named toPrettyPrintedStringLnet/minecraft/nbt/NbtHelper;toPrettyPrintedString(Lnet/minecraft/nbt/NbtCompound;)Ljava/lang/String;
-
method_32260
public static NbtCompound method_32260(String string) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- Mappings:
Namespace Name Mixin selector official aLnd;a(Ljava/lang/String;)Lmr;intermediary method_32260Lnet/minecraft/class_2512;method_32260(Ljava/lang/String;)Lnet/minecraft/class_2487;named method_32260Lnet/minecraft/nbt/NbtHelper;method_32260(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-
method_32273
- Mappings:
Namespace Name Mixin selector official eLnd;e(Lmr;)Lmr;intermediary method_32273Lnet/minecraft/class_2512;method_32273(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;named method_32273Lnet/minecraft/nbt/NbtHelper;method_32273(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
-
method_32275
- Mappings:
Namespace Name Mixin selector official fLnd;f(Lmr;)Lmr;intermediary method_32275Lnet/minecraft/class_2512;method_32275(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;named method_32275Lnet/minecraft/nbt/NbtHelper;method_32275(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
-
method_32277
- Mappings:
Namespace Name Mixin selector official gLnd;g(Lmr;)Ljava/lang/String;intermediary method_32277Lnet/minecraft/class_2512;method_32277(Lnet/minecraft/class_2487;)Ljava/lang/String;named method_32277Lnet/minecraft/nbt/NbtHelper;method_32277(Lnet/minecraft/nbt/NbtCompound;)Ljava/lang/String;
-
method_32267
- Mappings:
Namespace Name Mixin selector official bLnd;b(Ljava/lang/String;)Lmr;intermediary method_32267Lnet/minecraft/class_2512;method_32267(Ljava/lang/String;)Lnet/minecraft/class_2487;named method_32267Lnet/minecraft/nbt/NbtHelper;method_32267(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-