Class NbtUtils

java.lang.Object
net.minecraft.nbt.NbtUtils

public final class NbtUtils extends Object
  • Field Details

  • Constructor Details

    • NbtUtils

      private NbtUtils()
  • Method Details

    • compareNbt

      public static boolean compareNbt(@Nullable Tag tag, @Nullable Tag other, boolean compareListTag)
    • readBlockState

      public static BlockState readBlockState(HolderGetter<Block> blockGetter, CompoundTag tag)
    • setValueHelper

      private static <S extends StateHolder<?, S>, T extends Comparable<T>> S setValueHelper(S stateHolder, Property<T> property, String propertyName, CompoundTag propertiesTag, CompoundTag blockStateTag)
    • writeBlockState

      public static CompoundTag writeBlockState(BlockState state)
    • writeFluidState

      public static CompoundTag writeFluidState(FluidState state)
    • getName

      private static <T extends Comparable<T>> String getName(Property<T> property, Comparable<?> value)
    • prettyPrint

      public static String prettyPrint(Tag tag)
    • prettyPrint

      public static String prettyPrint(Tag tag, boolean prettyPrintArray)
    • prettyPrint

      public static StringBuilder prettyPrint(StringBuilder stringBuilder, Tag tag, int indentLevel, boolean prettyPrintArray)
    • indent

      private static StringBuilder indent(int indentLevel, StringBuilder stringBuilder)
    • toPrettyComponent

      public static Component toPrettyComponent(Tag tag)
    • structureToSnbt

      public static String structureToSnbt(CompoundTag tag)
    • snbtToStructure

      public static CompoundTag snbtToStructure(String text) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • packStructureTemplate

      static CompoundTag packStructureTemplate(CompoundTag tag)
    • unpackStructureTemplate

      static CompoundTag unpackStructureTemplate(CompoundTag tag)
    • packBlockState

      static String packBlockState(CompoundTag tag)
    • unpackBlockState

      static CompoundTag unpackBlockState(String blockStateText)
    • addCurrentDataVersion

      public static CompoundTag addCurrentDataVersion(CompoundTag tag)
    • addDataVersion

      public static CompoundTag addDataVersion(CompoundTag tag, int dataVersion)
    • addCurrentDataVersion

      public static void addCurrentDataVersion(ValueOutput output)
    • addDataVersion

      public static void addDataVersion(ValueOutput output, int dataVersion)
    • getDataVersion

      public static int getDataVersion(CompoundTag tag, int defaultValue)
    • getDataVersion

      public static int getDataVersion(com.mojang.serialization.Dynamic<?> tag, int defaultValue)