Package net.minecraft.nbt
Class NbtHelper
java.lang.Object
net.minecraft.nbt.NbtHelper
public final class NbtHelper extends Object
- Mappings:
Namespace Name official nc
intermediary net/minecraft/class_2512
named net/minecraft/nbt/NbtHelper
-
Field Summary
Fields Modifier and Type Field Description private static Comparator<ListTag>
field_27816
private static Comparator<ListTag>
field_27817
private static Splitter
field_27818
private static Splitter
field_27819
private static Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description NbtHelper()
-
Method Summary
Modifier and Type Method Description static CompoundTag
fromBlockPos(BlockPos pos)
static CompoundTag
fromBlockState(BlockState state)
static CompoundTag
fromGameProfile(CompoundTag tag, com.mojang.authlib.GameProfile profile)
static IntArrayTag
fromUuid(UUID uuid)
Serializes aUUID
into its equivalent NBT representation.static boolean
matches(Tag standard, Tag subject, boolean equalValue)
static CompoundTag
method_32260(String string)
(package private) static CompoundTag
method_32267(String string)
(package private) static CompoundTag
method_32273(CompoundTag tag)
(package private) static CompoundTag
method_32275(CompoundTag compoundTag)
(package private) static String
method_32277(CompoundTag compoundTag)
private static <T extends Comparable<T>>
StringnameValue(Property<T> property, Comparable<?> value)
static BlockPos
toBlockPos(CompoundTag tag)
static BlockState
toBlockState(CompoundTag tag)
static com.mojang.authlib.GameProfile
toGameProfile(CompoundTag tag)
static String
toPrettyPrintedString(CompoundTag tag)
static Text
toPrettyPrintedText(Tag tag)
static UUID
toUuid(Tag tag)
Deserializes a tag into aUUID
.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.static CompoundTag
update(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
- Mappings:
Namespace Name Mixin selector official a
Lnc;a: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 b
Lnc;b: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_27818
- Mappings:
Namespace Name Mixin selector official c
Lnc;c:Lcom/google/common/base/Splitter;
intermediary field_27818
Lnet/minecraft/class_2512;field_27818:Lcom/google/common/base/Splitter;
named field_27818
Lnet/minecraft/nbt/NbtHelper;field_27818:Lcom/google/common/base/Splitter;
-
field_27819
- Mappings:
Namespace Name Mixin selector official d
Lnc;d: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 e
Lnc;e: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;
-
-
Constructor Details
-
NbtHelper
public NbtHelper()
-
-
Method Details
-
toGameProfile
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lmq;)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/CompoundTag;)Lcom/mojang/authlib/GameProfile;
-
fromGameProfile
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lmq;Lcom/mojang/authlib/GameProfile;)Lmq;
intermediary method_10684
Lnet/minecraft/class_2512;method_10684(Lnet/minecraft/class_2487;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/class_2487;
named fromGameProfile
Lnet/minecraft/nbt/NbtHelper;fromGameProfile(Lnet/minecraft/nbt/CompoundTag;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/nbt/CompoundTag;
-
matches
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lni;Lni;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/Tag;Lnet/minecraft/nbt/Tag;Z)Z
-
fromUuid
Serializes aUUID
into its equivalent NBT representation.- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Ljava/util/UUID;)Lmu;
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/IntArrayTag;
-
toUuid
Deserializes a tag into aUUID
. The tag's data must have the same structure as the output offromUuid(java.util.UUID)
.- Throws:
IllegalArgumentException
- iftag
is not a valid representation of a UUID- Since:
- 20w10a
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lni;)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/Tag;)Ljava/util/UUID;
-
toBlockPos
- Mappings:
Namespace Name Mixin selector official b
Lnc;b(Lmq;)Lfx;
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/CompoundTag;)Lnet/minecraft/util/math/BlockPos;
-
fromBlockPos
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lfx;)Lmq;
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/CompoundTag;
-
toBlockState
- Mappings:
Namespace Name Mixin selector official c
Lnc;c(Lmq;)Lcht;
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/CompoundTag;)Lnet/minecraft/block/BlockState;
-
withProperty
private static <S extends State<?, S>, T extends Comparable<T>> S withProperty(S state, Property<T> property, String key, CompoundTag propertiesTag, CompoundTag mainTag)- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lchv;Lciw;Ljava/lang/String;Lmq;Lmq;)Lchv;
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/CompoundTag;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/state/State;
-
fromBlockState
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lcht;)Lmq;
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/CompoundTag;
-
nameValue
private static <T extends Comparable<T>> String nameValue(Property<T> property, Comparable<?> value)- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lciw;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;
-
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- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lcom/mojang/datafixers/DataFixer;Lags;Lmq;I)Lmq;
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/CompoundTag;I)Lnet/minecraft/nbt/CompoundTag;
-
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- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Lcom/mojang/datafixers/DataFixer;Lags;Lmq;II)Lmq;
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/CompoundTag;II)Lnet/minecraft/nbt/CompoundTag;
-
toPrettyPrintedText
- Mappings:
Namespace Name Mixin selector official c
Lnc;c(Lni;)Loi;
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/Tag;)Lnet/minecraft/text/Text;
-
toPrettyPrintedString
- Mappings:
Namespace Name Mixin selector official d
Lnc;d(Lmq;)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/CompoundTag;)Ljava/lang/String;
-
method_32260
public static CompoundTag method_32260(String string) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
- Mappings:
Namespace Name Mixin selector official a
Lnc;a(Ljava/lang/String;)Lmq;
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/CompoundTag;
-
method_32273
- Mappings:
Namespace Name Mixin selector official e
Lnc;e(Lmq;)Lmq;
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/CompoundTag;)Lnet/minecraft/nbt/CompoundTag;
-
method_32275
- Mappings:
Namespace Name Mixin selector official f
Lnc;f(Lmq;)Lmq;
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/CompoundTag;)Lnet/minecraft/nbt/CompoundTag;
-
method_32277
- Mappings:
Namespace Name Mixin selector official g
Lnc;g(Lmq;)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/CompoundTag;)Ljava/lang/String;
-
method_32267
- Mappings:
Namespace Name Mixin selector official b
Lnc;b(Ljava/lang/String;)Lmq;
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/CompoundTag;
-