Class NbtUtils
java.lang.Object
net.minecraft.nbt.NbtUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Codec<ResourceKey<Block>> private static final com.google.common.base.Splitterprivate static final com.google.common.base.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> Dynamic<T> addDataVersion(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(Dynamic<?> dynamic) static intgetDataVersion(Dynamic<?> dynamic, int _default) static intstatic intgetDataVersion(CompoundTag tag, int _default) 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, 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) private static voidwriteStateProperties(StateHolder<?, ?> state, CompoundTag tag)
-
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
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
-
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) -
writeStateProperties
-
writeBlockState
-
writeFluidState
-
prettyPrint
-
prettyPrint
public static StringBuilder prettyPrint(StringBuilder builder, Tag input, int indent, boolean withBinaryBlobs) -
indent
-
toPrettyComponent
-
structureToSnbt
-
snbtToStructure
- Throws:
CommandSyntaxException
-
packStructureTemplate
-
unpackStructureTemplate
-
packBlockState
-
unpackBlockState
-
addCurrentDataVersion
-
addDataVersion
-
addDataVersion
-
addCurrentDataVersion
-
addDataVersion
-
getDataVersion
-
getDataVersion
-
getDataVersion
-
getDataVersion
-