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 pTag, @Nullable Tag pOther, boolean pCompareListTag)
    • readBlockState

      public static BlockState readBlockState(HolderGetter<Block> pBlockGetter, CompoundTag pTag)
    • setValueHelper

      private static <S extends StateHolder<?, S>, T extends Comparable<T>> S setValueHelper(S pStateHolder, Property<T> pProperty, String pPropertyName, CompoundTag pPropertiesTag, CompoundTag pBlockStateTag)
    • writeBlockState

      public static CompoundTag writeBlockState(BlockState pState)
    • writeFluidState

      public static CompoundTag writeFluidState(FluidState pState)
    • getName

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

      public static String prettyPrint(Tag pTag)
    • prettyPrint

      public static String prettyPrint(Tag pTag, boolean pPrettyPrintArray)
    • prettyPrint

      public static StringBuilder prettyPrint(StringBuilder pStringBuilder, Tag pTag, int pIndentLevel, boolean pPrettyPrintArray)
    • indent

      private static StringBuilder indent(int pIndentLevel, StringBuilder pStringBuilder)
    • toPrettyComponent

      public static Component toPrettyComponent(Tag pTag)
    • structureToSnbt

      public static String structureToSnbt(CompoundTag pTag)
    • snbtToStructure

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

      static CompoundTag packStructureTemplate(CompoundTag pTag)
    • unpackStructureTemplate

      static CompoundTag unpackStructureTemplate(CompoundTag pTag)
    • packBlockState

      static String packBlockState(CompoundTag pTag)
    • unpackBlockState

      static CompoundTag unpackBlockState(String pBlockStateText)
    • addCurrentDataVersion

      public static CompoundTag addCurrentDataVersion(CompoundTag pTag)
    • addDataVersion

      public static CompoundTag addDataVersion(CompoundTag pTag, int pDataVersion)
    • getDataVersion

      public static int getDataVersion(CompoundTag pTag, int pDefaultValue)
    • getDataVersion

      public static int getDataVersion(com.mojang.serialization.Dynamic<?> pTag, int pDefaultValue)