Class NbtUtils
java.lang.Object
net.minecraft.nbt.NbtUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.serialization.Codec<ResourceKey<Block>> private static final intprivate static final Splitterprivate static final Splitterprivate static final Stringprivate static final charstatic final Stringstatic final Stringprivate static final org.slf4j.Loggerprivate static final intprivate static final charprivate static final charstatic final Stringprivate static final Comparator<ListTag> private static final Comparator<ListTag> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompoundTagstatic voidaddCurrentDataVersion(ValueOutput output) static <T> com.mojang.serialization.Dynamic<T> addDataVersion(com.mojang.serialization.Dynamic<T> tag, int version) static CompoundTagaddDataVersion(CompoundTag tag, int version) static voidaddDataVersion(ValueOutput output, int version) static booleancompareNbt(@Nullable Tag expected, @Nullable Tag actual, boolean partialListMatches) static intgetDataVersion(com.mojang.serialization.Dynamic<?> dynamic) static intgetDataVersion(com.mojang.serialization.Dynamic<?> dynamic, int _default) static intstatic intgetDataVersion(CompoundTag tag, int _default) (package private) static StringpackBlockState(CompoundTag compound, int version) (package private) static CompoundTagstatic BlockStatereadBlockState(HolderGetter<Block> blocks, CompoundTag tag) private static <S extends StateHolder<?,S>, T extends Comparable<T>>
SsetValueHelper(S result, Property<T> property, String key, CompoundTag properties, CompoundTag tag) static CompoundTagsnbtToStructure(String snbt) static StringstructureToSnbt(CompoundTag structure) static ComponenttoPrettyComponent(Tag tag) (package private) static CompoundTagunpackBlockState(String compound, int version) (package private) static CompoundTagunpackStructureTemplate(CompoundTag template) static CompoundTagwriteBlockState(BlockState state) private static voidwriteStateProperties(StateHolder<?, ?> state, CompoundTag tag)
-
Field Details
-
YXZ_LISTTAG_INT_COMPARATOR
-
YXZ_LISTTAG_DOUBLE_COMPARATOR
-
BLOCK_NAME_CODEC
-
SNBT_DATA_TAG
- See Also:
-
PROPERTIES_START
private static final char PROPERTIES_START- See Also:
-
PROPERTIES_END
private static final char PROPERTIES_END- See Also:
-
ELEMENT_SEPARATOR
- See Also:
-
KEY_VALUE_SEPARATOR
private static final char KEY_VALUE_SEPARATOR- See Also:
-
COMMA_SPLITTER
-
COLON_SPLITTER
-
LOGGER
private static final org.slf4j.Logger LOGGER -
NOT_FOUND
private static final int NOT_FOUND- See Also:
-
BLOCK_STATE_ID_PROPERTIES_RENAME_VERSION
private static final int BLOCK_STATE_ID_PROPERTIES_RENAME_VERSION- See Also:
-
LEGACY_BLOCK_STATE_ID_TAG
- See Also:
-
LEGACY_BLOCKSTATE_PROPERTY_TAG
- See Also:
-
-
Constructor Details
-
NbtUtils
private NbtUtils()
-
-
Method Details
-
compareNbt
-
readBlockState
-
setValueHelper
private static <S extends StateHolder<?,S>, T extends Comparable<T>> S setValueHelper(S result, Property<T> property, String key, CompoundTag properties, CompoundTag tag) -
writeStateProperties
-
writeBlockState
-
toPrettyComponent
-
structureToSnbt
-
snbtToStructure
public static CompoundTag snbtToStructure(String snbt) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
packStructureTemplate
-
unpackStructureTemplate
-
packBlockState
-
unpackBlockState
-
addCurrentDataVersion
-
addDataVersion
-
addDataVersion
public static <T> com.mojang.serialization.Dynamic<T> addDataVersion(com.mojang.serialization.Dynamic<T> tag, int version) -
addCurrentDataVersion
-
addDataVersion
-
getDataVersion
-
getDataVersion
-
getDataVersion
public static int getDataVersion(com.mojang.serialization.Dynamic<?> dynamic) -
getDataVersion
public static int getDataVersion(com.mojang.serialization.Dynamic<?> dynamic, int _default)
-