Package net.minecraft.nbt
Class NbtHelper
java.lang.Object
net.minecraft.nbt.NbtHelper
- Mappings:
Namespace Name official nm
intermediary net/minecraft/class_2512
named net/minecraft/nbt/NbtHelper
-
Field Summary
Modifier and TypeFieldDescriptionprivate static Splitter
private static Comparator<NbtList>
private static Comparator<NbtList>
private static Splitter
static String
private static char
private static char
private static String
private static char
private static int
private static int
private static Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic NbtCompound
fromBlockPos(BlockPos pos)
static NbtCompound
fromBlockState(BlockState state)
static NbtIntArray
Serializes aUUID
into its equivalent NBT representation.static boolean
matches(@Nullable NbtElement standard, @Nullable NbtElement subject, boolean equalValue)
static NbtCompound
method_32260(String string)
(package private) static NbtCompound
method_32267(String string)
(package private) static NbtCompound
method_32273(NbtCompound compound)
(package private) static NbtCompound
method_32275(NbtCompound compound)
(package private) static String
method_32277(NbtCompound compound)
private static StringBuilder
method_36114(int int2, StringBuilder stringBuilder)
static NbtCompound
method_36115(FluidState fluidState)
static StringBuilder
method_36116(StringBuilder stringBuilder, NbtElement nbtElement, int int2, boolean bool)
static String
method_36117(NbtElement nbtElement, boolean bool)
static String
method_36118(NbtElement nbtElement)
private static <T extends Comparable<T>>
StringnameValue(Property<T> property, Comparable<?> value)
static BlockPos
toBlockPos(NbtCompound compound)
static BlockState
toBlockState(NbtCompound compound)
static @Nullable com.mojang.authlib.GameProfile
toGameProfile(NbtCompound compound)
static String
toPrettyPrintedString(NbtCompound compound)
static Text
toPrettyPrintedText(NbtElement element)
static UUID
toUuid(NbtElement element)
Deserializes an NBT element into aUUID
.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.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.private static <S extends State<?, S>, T extends Comparable<T>>
SwithProperty(S state, Property<T> property, String key, NbtCompound properties, NbtCompound root)
static NbtCompound
writeGameProfile(NbtCompound compound, com.mojang.authlib.GameProfile profile)
-
Field Details
-
field_27816
- Mappings:
Namespace Name Mixin selector official b
Lnm;b:Ljava/util/Comparator;
intermediary field_27816
Lnet/minecraft/class_2512;field_27816:Ljava/util/Comparator;
named field_27816
Lnet/minecraft/nbt/NbtHelper;field_27816:Ljava/util/Comparator;
-
field_27817
- Mappings:
Namespace Name Mixin selector official c
Lnm;c:Ljava/util/Comparator;
intermediary field_27817
Lnet/minecraft/class_2512;field_27817:Ljava/util/Comparator;
named field_27817
Lnet/minecraft/nbt/NbtHelper;field_27817:Ljava/util/Comparator;
-
field_33224
- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official a
Lnm;a:Ljava/lang/String;
intermediary field_33224
Lnet/minecraft/class_2512;field_33224:Ljava/lang/String;
named field_33224
Lnet/minecraft/nbt/NbtHelper;field_33224:Ljava/lang/String;
-
field_33225
private static final char field_33225- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official d
Lnm;d:C
intermediary field_33225
Lnet/minecraft/class_2512;field_33225:C
named field_33225
Lnet/minecraft/nbt/NbtHelper;field_33225:C
-
field_33226
private static final char field_33226- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official e
Lnm;e:C
intermediary field_33226
Lnet/minecraft/class_2512;field_33226:C
named field_33226
Lnet/minecraft/nbt/NbtHelper;field_33226:C
-
field_33227
- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official f
Lnm;f:Ljava/lang/String;
intermediary field_33227
Lnet/minecraft/class_2512;field_33227:Ljava/lang/String;
named field_33227
Lnet/minecraft/nbt/NbtHelper;field_33227:Ljava/lang/String;
-
field_33228
private static final char field_33228- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official g
Lnm;g:C
intermediary field_33228
Lnet/minecraft/class_2512;field_33228:C
named field_33228
Lnet/minecraft/nbt/NbtHelper;field_33228:C
-
COMMA_SPLITTER
- Mappings:
Namespace Name Mixin selector official h
Lnm;h:Lcom/google/common/base/Splitter;
intermediary field_27818
Lnet/minecraft/class_2512;field_27818:Lcom/google/common/base/Splitter;
named COMMA_SPLITTER
Lnet/minecraft/nbt/NbtHelper;COMMA_SPLITTER:Lcom/google/common/base/Splitter;
-
field_27819
- Mappings:
Namespace Name Mixin selector official i
Lnm;i:Lcom/google/common/base/Splitter;
intermediary field_27819
Lnet/minecraft/class_2512;field_27819:Lcom/google/common/base/Splitter;
named field_27819
Lnet/minecraft/nbt/NbtHelper;field_27819:Lcom/google/common/base/Splitter;
-
LOGGER
- Mappings:
Namespace Name Mixin selector official j
Lnm;j:Lorg/apache/logging/log4j/Logger;
intermediary field_11582
Lnet/minecraft/class_2512;field_11582:Lorg/apache/logging/log4j/Logger;
named LOGGER
Lnet/minecraft/nbt/NbtHelper;LOGGER:Lorg/apache/logging/log4j/Logger;
-
field_33229
private static final int field_33229- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official k
Lnm;k:I
intermediary field_33229
Lnet/minecraft/class_2512;field_33229:I
named field_33229
Lnet/minecraft/nbt/NbtHelper;field_33229:I
-
field_33230
private static final int field_33230- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official l
Lnm;l:I
intermediary field_33230
Lnet/minecraft/class_2512;field_33230:I
named field_33230
Lnet/minecraft/nbt/NbtHelper;field_33230:I
-
-
Constructor Details
-
NbtHelper
private NbtHelper()
-
-
Method Details
-
toGameProfile
@Nullable public static @Nullable com.mojang.authlib.GameProfile toGameProfile(NbtCompound compound)- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Lna;)Lcom/mojang/authlib/GameProfile;
intermediary method_10683
Lnet/minecraft/class_2512;method_10683(Lnet/minecraft/class_2487;)Lcom/mojang/authlib/GameProfile;
named toGameProfile
Lnet/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 a
Lnm;a(Lna;Lcom/mojang/authlib/GameProfile;)Lna;
intermediary method_10684
Lnet/minecraft/class_2512;method_10684(Lnet/minecraft/class_2487;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/class_2487;
named writeGameProfile
Lnet/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 a
Lnm;a(Lns;Lns;Z)Z
intermediary method_10687
Lnet/minecraft/class_2512;method_10687(Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;Z)Z
named matches
Lnet/minecraft/nbt/NbtHelper;matches(Lnet/minecraft/nbt/NbtElement;Lnet/minecraft/nbt/NbtElement;Z)Z
-
fromUuid
Serializes aUUID
into its equivalent NBT representation.- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Ljava/util/UUID;)Lne;
intermediary method_25929
Lnet/minecraft/class_2512;method_25929(Ljava/util/UUID;)Lnet/minecraft/class_2495;
named fromUuid
Lnet/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
- ifelement
is not a valid representation of a UUID- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Lns;)Ljava/util/UUID;
intermediary method_25930
Lnet/minecraft/class_2512;method_25930(Lnet/minecraft/class_2520;)Ljava/util/UUID;
named toUuid
Lnet/minecraft/nbt/NbtHelper;toUuid(Lnet/minecraft/nbt/NbtElement;)Ljava/util/UUID;
-
toBlockPos
- Mappings:
Namespace Name Mixin selector official b
Lnm;b(Lna;)Lgg;
intermediary method_10691
Lnet/minecraft/class_2512;method_10691(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2338;
named toBlockPos
Lnet/minecraft/nbt/NbtHelper;toBlockPos(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/util/math/BlockPos;
-
fromBlockPos
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Lgg;)Lna;
intermediary method_10692
Lnet/minecraft/class_2512;method_10692(Lnet/minecraft/class_2338;)Lnet/minecraft/class_2487;
named fromBlockPos
Lnet/minecraft/nbt/NbtHelper;fromBlockPos(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/nbt/NbtCompound;
-
toBlockState
- Mappings:
Namespace Name Mixin selector official c
Lnm;c(Lna;)Lcks;
intermediary method_10681
Lnet/minecraft/class_2512;method_10681(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2680;
named toBlockState
Lnet/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 a
Lnm;a(Lcku;Lclv;Ljava/lang/String;Lna;Lna;)Lcku;
intermediary method_10682
Lnet/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 withProperty
Lnet/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 a
Lnm;a(Lcks;)Lna;
intermediary method_10686
Lnet/minecraft/class_2512;method_10686(Lnet/minecraft/class_2680;)Lnet/minecraft/class_2487;
named fromBlockState
Lnet/minecraft/nbt/NbtHelper;fromBlockState(Lnet/minecraft/block/BlockState;)Lnet/minecraft/nbt/NbtCompound;
-
method_36115
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Ldes;)Lna;
intermediary method_36115
Lnet/minecraft/class_2512;method_36115(Lnet/minecraft/class_3610;)Lnet/minecraft/class_2487;
named method_36115
Lnet/minecraft/nbt/NbtHelper;method_36115(Lnet/minecraft/fluid/FluidState;)Lnet/minecraft/nbt/NbtCompound;
-
nameValue
private static <T extends Comparable<T>> String nameValue(Property<T> property, Comparable<?> value)- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Lclv;Ljava/lang/Comparable;)Ljava/lang/String;
intermediary method_10685
Lnet/minecraft/class_2512;method_10685(Lnet/minecraft/class_2769;Ljava/lang/Comparable;)Ljava/lang/String;
named nameValue
Lnet/minecraft/nbt/NbtHelper;nameValue(Lnet/minecraft/state/property/Property;Ljava/lang/Comparable;)Ljava/lang/String;
-
method_36118
- Mappings:
Namespace Name Mixin selector official b
Lnm;b(Lns;)Ljava/lang/String;
intermediary method_36118
Lnet/minecraft/class_2512;method_36118(Lnet/minecraft/class_2520;)Ljava/lang/String;
named method_36118
Lnet/minecraft/nbt/NbtHelper;method_36118(Lnet/minecraft/nbt/NbtElement;)Ljava/lang/String;
-
method_36117
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Lns;Z)Ljava/lang/String;
intermediary method_36117
Lnet/minecraft/class_2512;method_36117(Lnet/minecraft/class_2520;Z)Ljava/lang/String;
named method_36117
Lnet/minecraft/nbt/NbtHelper;method_36117(Lnet/minecraft/nbt/NbtElement;Z)Ljava/lang/String;
-
method_36116
public static StringBuilder method_36116(StringBuilder stringBuilder, NbtElement nbtElement, int int2, boolean bool)- Mappings:
Namespace Name Mixin selector official a
Lnm;a(Ljava/lang/StringBuilder;Lns;IZ)Ljava/lang/StringBuilder;
intermediary method_36116
Lnet/minecraft/class_2512;method_36116(Ljava/lang/StringBuilder;Lnet/minecraft/class_2520;IZ)Ljava/lang/StringBuilder;
named method_36116
Lnet/minecraft/nbt/NbtHelper;method_36116(Ljava/lang/StringBuilder;Lnet/minecraft/nbt/NbtElement;IZ)Ljava/lang/StringBuilder;
-
method_36114
- Mappings:
Namespace Name Mixin selector official a
Lnm;a(ILjava/lang/StringBuilder;)Ljava/lang/StringBuilder;
intermediary method_36114
Lnet/minecraft/class_2512;method_36114(ILjava/lang/StringBuilder;)Ljava/lang/StringBuilder;
named method_36114
Lnet/minecraft/nbt/NbtHelper;method_36114(ILjava/lang/StringBuilder;)Ljava/lang/StringBuilder;
-
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 a
Lnm;a(Lcom/mojang/datafixers/DataFixer;Lahp;Lna;I)Lna;
intermediary method_10688
Lnet/minecraft/class_2512;method_10688(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;I)Lnet/minecraft/class_2487;
named update
Lnet/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 a
Lnm;a(Lcom/mojang/datafixers/DataFixer;Lahp;Lna;II)Lna;
intermediary method_10693
Lnet/minecraft/class_2512;method_10693(Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;II)Lnet/minecraft/class_2487;
named update
Lnet/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 c
Lnm;c(Lns;)Los;
intermediary method_32270
Lnet/minecraft/class_2512;method_32270(Lnet/minecraft/class_2520;)Lnet/minecraft/class_2561;
named toPrettyPrintedText
Lnet/minecraft/nbt/NbtHelper;toPrettyPrintedText(Lnet/minecraft/nbt/NbtElement;)Lnet/minecraft/text/Text;
-
toPrettyPrintedString
- Mappings:
Namespace Name Mixin selector official d
Lnm;d(Lna;)Ljava/lang/String;
intermediary method_32271
Lnet/minecraft/class_2512;method_32271(Lnet/minecraft/class_2487;)Ljava/lang/String;
named toPrettyPrintedString
Lnet/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 a
Lnm;a(Ljava/lang/String;)Lna;
intermediary method_32260
Lnet/minecraft/class_2512;method_32260(Ljava/lang/String;)Lnet/minecraft/class_2487;
named method_32260
Lnet/minecraft/nbt/NbtHelper;method_32260(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-
method_32273
- Mappings:
Namespace Name Mixin selector official e
Lnm;e(Lna;)Lna;
intermediary method_32273
Lnet/minecraft/class_2512;method_32273(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;
named method_32273
Lnet/minecraft/nbt/NbtHelper;method_32273(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
-
method_32275
- Mappings:
Namespace Name Mixin selector official f
Lnm;f(Lna;)Lna;
intermediary method_32275
Lnet/minecraft/class_2512;method_32275(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;
named method_32275
Lnet/minecraft/nbt/NbtHelper;method_32275(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
-
method_32277
- Mappings:
Namespace Name Mixin selector official g
Lnm;g(Lna;)Ljava/lang/String;
intermediary method_32277
Lnet/minecraft/class_2512;method_32277(Lnet/minecraft/class_2487;)Ljava/lang/String;
named method_32277
Lnet/minecraft/nbt/NbtHelper;method_32277(Lnet/minecraft/nbt/NbtCompound;)Ljava/lang/String;
-
method_32267
- Mappings:
Namespace Name Mixin selector official b
Lnm;b(Ljava/lang/String;)Lna;
intermediary method_32267
Lnet/minecraft/class_2512;method_32267(Ljava/lang/String;)Lnet/minecraft/class_2487;
named method_32267
Lnet/minecraft/nbt/NbtHelper;method_32267(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-