Class DataItem

  • All Implemented Interfaces:
    Item

    public class DataItem
    extends java.lang.Object
    implements Item
    • Constructor Summary

      Constructors 
      Constructor Description
      DataItem()  
      DataItem​(int identifier, byte amount, short data, @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)  
      DataItem​(Item toCopy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int amount()
      Returns the item amount.
      short data()
      Returns the item data.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      int identifier()
      Returns the item identifier.
      void setAmount​(int amount)
      Returns the item amount.
      void setData​(short data)
      Sets the item data used in versions before 1.13.
      void setIdentifier​(int identifier)
      Sets the item identifier.
      void setTag​(@Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
      Sets the item compound tag.
      @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag()
      Returns the item compound tag if present.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DataItem

        public DataItem()
      • DataItem

        public DataItem​(int identifier,
                        byte amount,
                        short data,
                        @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
      • DataItem

        public DataItem​(Item toCopy)
    • Method Detail

      • identifier

        public int identifier()
        Description copied from interface: Item
        Returns the item identifier.
        Specified by:
        identifier in interface Item
        Returns:
        item identifier
      • setIdentifier

        public void setIdentifier​(int identifier)
        Description copied from interface: Item
        Sets the item identifier.
        Specified by:
        setIdentifier in interface Item
        Parameters:
        identifier - item identifier
      • amount

        public int amount()
        Description copied from interface: Item
        Returns the item amount.
        Specified by:
        amount in interface Item
        Returns:
        item amount
      • setAmount

        public void setAmount​(int amount)
        Description copied from interface: Item
        Returns the item amount.
        Specified by:
        setAmount in interface Item
        Parameters:
        amount - item amount
      • data

        public short data()
        Description copied from interface: Item
        Returns the item data. Always 0 for 1.13+ items.
        Specified by:
        data in interface Item
        Returns:
        item data
      • setData

        public void setData​(short data)
        Description copied from interface: Item
        Sets the item data used in versions before 1.13.
        Specified by:
        setData in interface Item
        Parameters:
        data - item data
      • tag

        public @Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag()
        Description copied from interface: Item
        Returns the item compound tag if present.
        Specified by:
        tag in interface Item
        Returns:
        item tag
      • setTag

        public void setTag​(@Nullable com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
        Description copied from interface: Item
        Sets the item compound tag.
        Specified by:
        setTag in interface Item
        Parameters:
        tag - item tag
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object