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 com.mojang.serialization.Dynamic<Tag> addCurrentDataVersion(com.mojang.serialization.Dynamic<Tag> pTag) static CompoundTagstatic voidaddCurrentDataVersion(ValueOutput pOutput) static com.mojang.serialization.Dynamic<Tag> addDataVersion(com.mojang.serialization.Dynamic<Tag> pTag, int pDataVersion) static CompoundTagaddDataVersion(CompoundTag pTag, int pDataVersion) static voidaddDataVersion(ValueOutput pOutput, int pDataVersion) static booleancompareNbt(Tag pTag, Tag pOther, boolean pCompareListTag) static intgetDataVersion(com.mojang.serialization.Dynamic<?> pTag, int pDefaultValue) static intgetDataVersion(CompoundTag pTag, int pDefaultValue) private static <T extends Comparable<T>>
StringgetName(Property<T> pProperty, Comparable<?> pValue) private static StringBuilderindent(int pIndentLevel, StringBuilder pStringBuilder) (package private) static StringpackBlockState(CompoundTag pTag) (package private) static CompoundTagstatic StringBuilderprettyPrint(StringBuilder pStringBuilder, Tag pTag, int pIndentLevel, boolean pPrettyPrintArray) static StringprettyPrint(Tag pTag) static StringprettyPrint(Tag pTag, boolean pPrettyPrintArray) static BlockStatereadBlockState(HolderGetter<Block> pBlockGetter, CompoundTag pTag) private static <S extends StateHolder<?,S>, T extends Comparable<T>>
SsetValueHelper(S pStateHolder, Property<T> pProperty, String pPropertyName, CompoundTag pPropertiesTag, CompoundTag pBlockStateTag) static CompoundTagsnbtToStructure(String pText) static StringstructureToSnbt(CompoundTag pTag) static ComponenttoPrettyComponent(Tag pTag) (package private) static CompoundTagunpackBlockState(String pBlockStateText) (package private) static CompoundTagstatic CompoundTagwriteBlockState(BlockState pState) static CompoundTagwriteFluidState(FluidState pState)
-
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 pStateHolder, Property<T> pProperty, String pPropertyName, CompoundTag pPropertiesTag, CompoundTag pBlockStateTag) -
writeBlockState
-
writeFluidState
-
getName
private static <T extends Comparable<T>> String getName(Property<T> pProperty, Comparable<?> pValue) -
prettyPrint
-
prettyPrint
-
prettyPrint
public static StringBuilder prettyPrint(StringBuilder pStringBuilder, Tag pTag, int pIndentLevel, boolean pPrettyPrintArray) -
indent
-
toPrettyComponent
-
structureToSnbt
-
snbtToStructure
public static CompoundTag snbtToStructure(String pText) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
packStructureTemplate
-
unpackStructureTemplate
-
packBlockState
-
unpackBlockState
-
addCurrentDataVersion
-
addDataVersion
-
addCurrentDataVersion
-
addDataVersion
-
addCurrentDataVersion
-
addDataVersion
-
getDataVersion
-
getDataVersion
public static int getDataVersion(com.mojang.serialization.Dynamic<?> pTag, int pDefaultValue)
-