Class BaseItem

java.lang.Object
com.sk89q.worldedit.blocks.BaseItem
All Implemented Interfaces:
NbtValued
Direct Known Subclasses:
BaseItemStack

public class BaseItem extends Object implements NbtValued
Represents an item, without an amount value. See BaseItemStack for an instance with stack amount information.

This class may be removed in the future.

  • Constructor Details

    • BaseItem

      public BaseItem(ItemType itemType)
      Construct the object.
      Parameters:
      itemType - Type of the item
    • BaseItem

      @Deprecated public BaseItem(ItemType itemType, @Nullable CompoundTag nbtData)
      Deprecated.
      Construct the object.
      Parameters:
      itemType - Type of the item
      nbtData - NBT Compound tag
    • BaseItem

      public BaseItem(ItemType itemType, @Nullable LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> tag)
      Construct the object.
      Parameters:
      itemType - Type of the item
      tag - NBT Compound tag
  • Method Details

    • getType

      public ItemType getType()
      Get the type of item.
      Returns:
      the type
    • setType

      public void setType(ItemType itemType)
      Set the type of the item.
      Parameters:
      itemType - The type to set
    • getNativeItem

      @Deprecated @Nullable public Object getNativeItem()
      Deprecated.
    • getNbtReference

      @Nullable public LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> getNbtReference()
      Description copied from interface: NbtValued
      Get the object's NBT data (tile entity data).

      This only needs to be used if you don't want to immediately resolve the data. Otherwise, you probably want NbtValued.getNbt().

      Specified by:
      getNbtReference in interface NbtValued
      Returns:
      compound tag, or null
    • setNbtReference

      public void setNbtReference(@Nullable LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
      Description copied from interface: NbtValued
      Set the object's NBT data (tile entity data).
      Specified by:
      setNbtReference in interface NbtValued
      Parameters:
      nbtData - NBT data, or null if no data
    • toString

      public String toString()
      Overrides:
      toString in class Object