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 expected, @Nullable Tag actual, boolean partialListMatches)
    • readBlockState

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

      private static <S extends StateHolder<?,S>, T extends Comparable<T>> S setValueHelper(S result, Property<T> property, String key, CompoundTag properties, CompoundTag tag)
    • 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> key, Comparable<?> value)
    • prettyPrint

      public static String prettyPrint(Tag tag)
    • prettyPrint

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

      public static StringBuilder prettyPrint(StringBuilder builder, Tag input, int indent, boolean withBinaryBlobs)
    • indent

      private static StringBuilder indent(int indent, StringBuilder builder)
    • toPrettyComponent

      public static Component toPrettyComponent(Tag tag)
    • structureToSnbt

      public static String structureToSnbt(CompoundTag structure)
    • snbtToStructure

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

      static CompoundTag packStructureTemplate(CompoundTag snbt)
    • unpackStructureTemplate

      static CompoundTag unpackStructureTemplate(CompoundTag template)
    • packBlockState

      static String packBlockState(CompoundTag compound)
    • unpackBlockState

      static CompoundTag unpackBlockState(String compound)
    • addCurrentDataVersion

      public static CompoundTag addCurrentDataVersion(CompoundTag tag)
    • addDataVersion

      public static CompoundTag addDataVersion(CompoundTag tag, int version)
    • addDataVersion

      public static <T> com.mojang.serialization.Dynamic<T> addDataVersion(com.mojang.serialization.Dynamic<T> tag, int version)
    • addCurrentDataVersion

      public static void addCurrentDataVersion(ValueOutput output)
    • addDataVersion

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

      public static int getDataVersion(CompoundTag tag)
    • getDataVersion

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

      public static int getDataVersion(com.mojang.serialization.Dynamic<?> dynamic)
    • getDataVersion

      public static int getDataVersion(com.mojang.serialization.Dynamic<?> dynamic, int _default)