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 tag, int dataVersion) static boolean
compareNbt
(Tag p_tag, Tag other, boolean compareListTag) static IntArrayTag
createUUID
(UUID uuid) static int
getDataVersion
(CompoundTag tag, int defaultValue) private static <T extends Comparable<T>>
StringgetName
(Property<T> property, Comparable<?> value) private static StringBuilder
indent
(int indentLevel, StringBuilder stringBuilder) static UUID
(package private) static String
(package private) static CompoundTag
static StringBuilder
prettyPrint
(StringBuilder stringBuilder, Tag tag, int indentLevel, boolean prettyPrintArray) static String
prettyPrint
(Tag tag) static String
prettyPrint
(Tag tag, boolean prettyPrintArray) readBlockPos
(CompoundTag tag, String key) static BlockState
readBlockState
(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 CompoundTag
snbtToStructure
(String text) static String
static Component
toPrettyComponent
(Tag tag) (package private) static CompoundTag
unpackBlockState
(String blockStateText) (package private) static CompoundTag
static Tag
writeBlockPos
(BlockPos pos) static CompoundTag
writeBlockState
(BlockState state) static CompoundTag
writeFluidState
(FluidState state)
-
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 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
-