Package net.minecraft.nbt
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 CompoundTagaddDataVersion(CompoundTag tag, int dataVersion) static booleancompareNbt(Tag tag, Tag other, boolean compareListTag) static intgetDataVersion(com.mojang.serialization.Dynamic<?> tag, int defaultValue) static intgetDataVersion(CompoundTag tag, int defaultValue) private static <T extends Comparable<T>>
StringgetName(Property<T> property, Comparable<?> value) private static StringBuilderindent(int indentLevel, StringBuilder stringBuilder) (package private) static String(package private) static CompoundTagstatic StringBuilderprettyPrint(StringBuilder stringBuilder, Tag tag, int indentLevel, boolean prettyPrintArray) static StringprettyPrint(Tag tag) static StringprettyPrint(Tag tag, boolean prettyPrintArray) static BlockStatereadBlockState(HolderGetter<Block> blockGetter, CompoundTag tag) private static <S extends StateHolder<?,S>, T extends Comparable<T>>
SsetValueHelper(S stateHolder, Property<T> property, String propertyName, CompoundTag propertiesTag, CompoundTag blockStateTag) static CompoundTagsnbtToStructure(String text) static Stringstatic ComponenttoPrettyComponent(Tag tag) (package private) static CompoundTagunpackBlockState(String blockStateText) (package private) static CompoundTagstatic 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>, S setValueHelperT extends Comparable<T>> (S stateHolder, Property<T> property, String propertyName, CompoundTag propertiesTag, CompoundTag blockStateTag) -
writeBlockState
-
writeFluidState
-
getName
-
prettyPrint
-
prettyPrint
-
prettyPrint
public static StringBuilder prettyPrint(StringBuilder stringBuilder, Tag tag, int indentLevel, boolean prettyPrintArray) -
indent
-
toPrettyComponent
-
structureToSnbt
-
snbtToStructure
public static CompoundTag snbtToStructure(String text) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
packStructureTemplate
-
unpackStructureTemplate
-
packBlockState
-
unpackBlockState
-
addCurrentDataVersion
-
addDataVersion
-
getDataVersion
-
getDataVersion
public static int getDataVersion(com.mojang.serialization.Dynamic<?> tag, int defaultValue)
-