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 Splitterprivate static final Splitterprivate static final Stringprivate static final intprivate static final charprivate 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) private static <T extends Comparable<T>>
StringgetName(Property<T> key, Comparable<?> value) private static StringBuilderindent(int indent, StringBuilder builder) (package private) static StringpackBlockState(CompoundTag compound) (package private) static CompoundTagstatic StringBuilderprettyPrint(StringBuilder builder, Tag input, int indent, boolean withBinaryBlobs) static StringprettyPrint(Tag tag) static StringprettyPrint(Tag tag, boolean withBinaryBlobs) static 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) (package private) static CompoundTagunpackStructureTemplate(CompoundTag template) static CompoundTagwriteBlockState(BlockState state) static CompoundTagwriteFluidState(FluidState state)
-
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 -
INDENT
private static final int INDENT- See Also:
-
NOT_FOUND
private static final int NOT_FOUND- 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) -
writeBlockState
-
writeFluidState
-
getName
-
prettyPrint
-
prettyPrint
-
prettyPrint
public static StringBuilder prettyPrint(StringBuilder builder, Tag input, int indent, boolean withBinaryBlobs) -
indent
-
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)
-