Package net.minecraft.nbt
Class NbtUtils
java.lang.Object
net.minecraft.nbt.NbtUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.base.Splitter
private static final com.google.common.base.Splitter
private static final String
private static final int
private static final char
private static final org.slf4j.Logger
private static final int
private static final char
private static final char
static final String
private static final Comparator
<ListTag> private static final Comparator
<ListTag> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompoundTag
static CompoundTag
addDataVersion
(CompoundTag pTag, int pDataVersion) static boolean
compareNbt
(Tag pTag, Tag pOther, boolean pCompareListTag) static IntArrayTag
createUUID
(UUID pUuid) static int
getDataVersion
(CompoundTag pTag, int pDefaultValue) private static <T extends Comparable<T>>
StringgetName
(Property<T> pProperty, Comparable<?> pValue) private static StringBuilder
indent
(int pIndentLevel, StringBuilder pStringBuilder) static UUID
(package private) static String
packBlockState
(CompoundTag p_178076_) (package private) static CompoundTag
static StringBuilder
prettyPrint
(StringBuilder pStringBuilder, Tag pTag, int pIndentLevel, boolean pPrettyPrintArray) static String
prettyPrint
(Tag pTag) static String
prettyPrint
(Tag pTag, boolean pPrettyPrintArray) readBlockPos
(CompoundTag pTag, String pKey) static BlockState
readBlockState
(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 CompoundTag
snbtToStructure
(String pText) static String
structureToSnbt
(CompoundTag pTag) static Component
toPrettyComponent
(Tag pTag) (package private) static CompoundTag
unpackBlockState
(String p_178054_) (package private) static CompoundTag
static Tag
writeBlockPos
(BlockPos pPos) static CompoundTag
writeBlockState
(BlockState pState) static CompoundTag
writeFluidState
(FluidState pState)
-
Field Details
-
YXZ_LISTTAG_INT_COMPARATOR
-
YXZ_LISTTAG_DOUBLE_COMPARATOR
-
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
private static final com.google.common.base.Splitter COMMA_SPLITTER -
COLON_SPLITTER
private static final com.google.common.base.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
-
createUUID
-
loadUUID
-
readBlockPos
-
writeBlockPos
-
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
-
getDataVersion
-