public final class NbtHelper extends Object
| Modifier and Type | Field and 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 and Description |
|---|
NbtHelper() |
| Modifier and Type | Method and 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 a
UUID 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) |
static Text |
method_32270(Tag tag) |
static String |
method_32271(CompoundTag compoundTag) |
(package private) static CompoundTag |
method_32273(CompoundTag compoundTag) |
(package private) static CompoundTag |
method_32275(CompoundTag compoundTag) |
(package private) static String |
method_32277(CompoundTag compoundTag) |
private static <T extends Comparable<T>> |
nameValue(Property<T> property,
Comparable<?> value) |
static BlockPos |
toBlockPos(CompoundTag tag) |
static BlockState |
toBlockState(CompoundTag tag) |
static com.mojang.authlib.GameProfile |
toGameProfile(CompoundTag tag) |
static UUID |
toUuid(Tag tag)
Deserializes a tag into a
UUID. |
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>> |
withProperty(S state,
Property<T> property,
String key,
CompoundTag propertiesTag,
CompoundTag mainTag) |
private static final Comparator<ListTag> field_27816
private static final Comparator<ListTag> field_27817
private static final Splitter field_27818
private static final Splitter field_27819
private static final Logger LOGGER
@Nullable public static com.mojang.authlib.GameProfile toGameProfile(CompoundTag tag)
public static CompoundTag fromGameProfile(CompoundTag tag, com.mojang.authlib.GameProfile profile)
public static boolean matches(@Nullable Tag standard, @Nullable Tag subject, boolean equalValue)
public static IntArrayTag fromUuid(UUID uuid)
UUID into its equivalent NBT representation.public static UUID toUuid(Tag tag)
UUID.
The tag's data must have the same structure as the output of fromUuid(java.util.UUID).IllegalArgumentException - if tag is not a valid representation of a UUIDpublic static BlockPos toBlockPos(CompoundTag tag)
public static CompoundTag fromBlockPos(BlockPos pos)
public static BlockState toBlockState(CompoundTag tag)
private static <S extends State<?,S>,T extends Comparable<T>> S withProperty(S state, Property<T> property, String key, CompoundTag propertiesTag, CompoundTag mainTag)
public static CompoundTag fromBlockState(BlockState state)
private static <T extends Comparable<T>> String nameValue(Property<T> property, Comparable<?> value)
public static CompoundTag update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion)
fixer - the data fixerfixTypes - the fix typestag - the tag to fixoldVersion - the data version of the compound tagpublic static CompoundTag update(com.mojang.datafixers.DataFixer fixer, DataFixTypes fixTypes, CompoundTag tag, int oldVersion, int targetVersion)
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 topublic static String method_32271(CompoundTag compoundTag)
public static CompoundTag method_32260(String string) throws com.mojang.brigadier.exceptions.CommandSyntaxException
com.mojang.brigadier.exceptions.CommandSyntaxExceptionstatic CompoundTag method_32273(CompoundTag compoundTag)
static CompoundTag method_32275(CompoundTag compoundTag)
static String method_32277(CompoundTag compoundTag)
static CompoundTag method_32267(String string)