Class CompoundNBT

java.lang.Object
net.minecraft.nbt.CompoundNBT
All Implemented Interfaces:
INBT

public class CompoundNBT extends Object implements INBT
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<CompoundNBT> CODEC
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • SIMPLE_VALUE

      private static final Pattern SIMPLE_VALUE
    • TYPE

      public static final INBTType<CompoundNBT> TYPE
    • tags

      private final Map<String,INBT> tags
  • Constructor Details

    • CompoundNBT

      protected CompoundNBT(Map<String,INBT> p_i226075_1_)
    • CompoundNBT

      public CompoundNBT()
  • Method Details

    • write

      public void write(DataOutput p_74734_1_) throws IOException
      Specified by:
      write in interface INBT
      Throws:
      IOException
    • getAllKeys

      public Set<String> getAllKeys()
    • getId

      public byte getId()
      Specified by:
      getId in interface INBT
    • getType

      public INBTType<CompoundNBT> getType()
      Specified by:
      getType in interface INBT
    • size

      public int size()
    • put

      @Nullable public INBT put(String p_218657_1_, INBT p_218657_2_)
    • putByte

      public void putByte(String p_74774_1_, byte p_74774_2_)
    • putShort

      public void putShort(String p_74777_1_, short p_74777_2_)
    • putInt

      public void putInt(String p_74768_1_, int p_74768_2_)
    • putLong

      public void putLong(String p_74772_1_, long p_74772_2_)
    • putUUID

      public void putUUID(String p_186854_1_, UUID p_186854_2_)
    • getUUID

      public UUID getUUID(String p_186857_1_)
    • hasUUID

      public boolean hasUUID(String p_186855_1_)
    • putFloat

      public void putFloat(String p_74776_1_, float p_74776_2_)
    • putDouble

      public void putDouble(String p_74780_1_, double p_74780_2_)
    • putString

      public void putString(String p_74778_1_, String p_74778_2_)
    • putByteArray

      public void putByteArray(String p_74773_1_, byte[] p_74773_2_)
    • putIntArray

      public void putIntArray(String p_74783_1_, int[] p_74783_2_)
    • putIntArray

      public void putIntArray(String p_197646_1_, List<Integer> p_197646_2_)
    • putLongArray

      public void putLongArray(String p_197644_1_, long[] p_197644_2_)
    • putLongArray

      public void putLongArray(String p_202168_1_, List<Long> p_202168_2_)
    • putBoolean

      public void putBoolean(String p_74757_1_, boolean p_74757_2_)
    • get

      @Nullable public INBT get(String p_74781_1_)
    • getTagType

      public byte getTagType(String p_150299_1_)
    • contains

      public boolean contains(String p_74764_1_)
    • contains

      public boolean contains(String p_150297_1_, int p_150297_2_)
    • getByte

      public byte getByte(String p_74771_1_)
    • getShort

      public short getShort(String p_74765_1_)
    • getInt

      public int getInt(String p_74762_1_)
    • getLong

      public long getLong(String p_74763_1_)
    • getFloat

      public float getFloat(String p_74760_1_)
    • getDouble

      public double getDouble(String p_74769_1_)
    • getString

      public String getString(String p_74779_1_)
    • getByteArray

      public byte[] getByteArray(String p_74770_1_)
    • getIntArray

      public int[] getIntArray(String p_74759_1_)
    • getLongArray

      public long[] getLongArray(String p_197645_1_)
    • getCompound

      public CompoundNBT getCompound(String p_74775_1_)
    • getList

      public ListNBT getList(String p_150295_1_, int p_150295_2_)
    • getBoolean

      public boolean getBoolean(String p_74767_1_)
    • remove

      public void remove(String p_82580_1_)
    • toString

      public String toString()
      Specified by:
      toString in interface INBT
      Overrides:
      toString in class Object
    • isEmpty

      public boolean isEmpty()
    • createReport

      private CrashReport createReport(String p_229677_1_, INBTType<?> p_229677_2_, ClassCastException p_229677_3_)
    • copy

      public CompoundNBT copy()
      Specified by:
      copy in interface INBT
    • equals

      public boolean equals(Object p_equals_1_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • writeNamedTag

      private static void writeNamedTag(String p_150298_0_, INBT p_150298_1_, DataOutput p_150298_2_) throws IOException
      Throws:
      IOException
    • readNamedTagType

      private static byte readNamedTagType(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException
      Throws:
      IOException
    • readNamedTagName

      private static String readNamedTagName(DataInput p_152448_0_, NBTSizeTracker p_152448_1_) throws IOException
      Throws:
      IOException
    • readNamedTagData

      private static INBT readNamedTagData(INBTType<?> p_229680_0_, String p_229680_1_, DataInput p_229680_2_, int p_229680_3_, NBTSizeTracker p_229680_4_)
    • merge

      public CompoundNBT merge(CompoundNBT p_197643_1_)
    • handleEscape

      protected static String handleEscape(String p_193582_0_)
    • handleEscapePretty

      protected static ITextComponent handleEscapePretty(String p_197642_0_)
    • getPrettyDisplay

      public ITextComponent getPrettyDisplay(String p_199850_1_, int p_199850_2_)
      Specified by:
      getPrettyDisplay in interface INBT
    • entries

      protected Map<String,INBT> entries()