Class CloudItemStack

java.lang.Object
org.cloudburstmc.server.item.CloudItemStack
All Implemented Interfaces:
Comparable<org.cloudburstmc.api.item.ItemStack>, org.cloudburstmc.api.item.ItemStack
Direct Known Subclasses:
BlockItemStack

@Immutable @ParametersAreNonnullByDefault public class CloudItemStack extends Object implements org.cloudburstmc.api.item.ItemStack
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected Set<org.cloudburstmc.api.util.Identifier>
     
    protected Set<org.cloudburstmc.api.util.Identifier>
     
    protected Map<Class<?>,​Object>
     
    protected com.nukkitx.nbt.NbtMap
     
    protected com.google.common.collect.ImmutableMap<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance>
     
    protected org.cloudburstmc.api.util.Identifier
     
    protected List<String>
     
    protected String
     
    protected com.nukkitx.nbt.NbtMap
     
    protected com.nukkitx.protocol.bedrock.data.inventory.ItemData
     
    protected static Object
     
    protected int
     
    protected org.cloudburstmc.api.item.ItemType
     

    Fields inherited from interface org.cloudburstmc.api.item.ItemStack

    registry
  • Constructor Summary

    Constructors
    Constructor
    Description
    CloudItemStack​(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type)
     
    CloudItemStack​(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount)
     
    CloudItemStack​(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount, String itemName, List<String> itemLore, Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments, Collection<org.cloudburstmc.api.util.Identifier> canDestroy, Collection<org.cloudburstmc.api.util.Identifier> canPlaceOn, Map<Class<?>,​Object> data, com.nukkitx.nbt.NbtMap nbt, com.nukkitx.nbt.NbtMap dataTag, com.nukkitx.protocol.bedrock.data.inventory.ItemData networkData)
     
    CloudItemStack​(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount, String itemName, List<String> itemLore, Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments, Collection<org.cloudburstmc.api.util.Identifier> canDestroy, Collection<org.cloudburstmc.api.util.Identifier> canPlaceOn, Map<Class<?>,​Object> data, com.nukkitx.nbt.NbtMap nbt, com.nukkitx.nbt.NbtMap dataTag, com.nukkitx.protocol.bedrock.data.inventory.ItemData networkData, int netId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals​(Object o)
     
    boolean
    equals​(org.cloudburstmc.api.item.ItemStack item)
     
    boolean
    equals​(org.cloudburstmc.api.item.ItemStack other, boolean checkAmount, boolean checkData)
     
    int
     
    org.cloudburstmc.api.item.behavior.ItemBehavior
     
    Collection<org.cloudburstmc.api.util.Identifier>
     
    Collection<org.cloudburstmc.api.util.Identifier>
     
    com.google.common.collect.ImmutableMap<Class<?>,​Object>
     
    com.nukkitx.nbt.NbtMap
     
    Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance>
     
    org.cloudburstmc.api.util.Identifier
     
     
    <T> T
    getMetadata​(Class<T> metadataClass, T defaultValue)
     
     
     
    com.nukkitx.nbt.NbtMap
     
    com.nukkitx.nbt.NbtMap
    getNbt​(boolean serialize)
     
    com.nukkitx.protocol.bedrock.data.inventory.ItemData
     
    int
     
    org.cloudburstmc.api.item.ItemType
     
    int
     
    boolean
     
    boolean
     
    boolean
    isMergeable​(org.cloudburstmc.api.item.ItemStack other)
     
    boolean
     
    org.cloudburstmc.api.item.ItemStackBuilder
     
    org.cloudburstmc.api.item.ItemStack
    withData​(Class<?> metadataClass, Object data)
     
    org.cloudburstmc.api.item.ItemStack
    withData​(Object data)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cloudburstmc.api.item.ItemStack

    canDestroy, canPlaceOn, compareTo, decrementAmount, decrementAmount, equals, getBlockState, getEnchantment, getMetadata, hasEnchantments, hasName, incrementAmount, incrementAmount, isFull, withAmount, withEnchantment
  • Field Details

    • NONE_VALUE

      protected static final Object NONE_VALUE
    • id

      protected volatile org.cloudburstmc.api.util.Identifier id
    • type

      protected final org.cloudburstmc.api.item.ItemType type
    • amount

      protected final int amount
    • itemName

      protected final String itemName
    • itemLore

      protected final List<String> itemLore
    • enchantments

      protected final com.google.common.collect.ImmutableMap<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments
    • canDestroy

      protected final Set<org.cloudburstmc.api.util.Identifier> canDestroy
    • canPlaceOn

      protected final Set<org.cloudburstmc.api.util.Identifier> canPlaceOn
    • data

      protected final Map<Class<?>,​Object> data
    • stackNetId

      protected final int stackNetId
    • nbt

      protected volatile com.nukkitx.nbt.NbtMap nbt
    • dataTag

      protected volatile com.nukkitx.nbt.NbtMap dataTag
    • networkData

      protected volatile com.nukkitx.protocol.bedrock.data.inventory.ItemData networkData
  • Constructor Details

    • CloudItemStack

      public CloudItemStack(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type)
    • CloudItemStack

      public CloudItemStack(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount)
    • CloudItemStack

      public CloudItemStack(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount, String itemName, List<String> itemLore, Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments, Collection<org.cloudburstmc.api.util.Identifier> canDestroy, Collection<org.cloudburstmc.api.util.Identifier> canPlaceOn, Map<Class<?>,​Object> data, com.nukkitx.nbt.NbtMap nbt, com.nukkitx.nbt.NbtMap dataTag, com.nukkitx.protocol.bedrock.data.inventory.ItemData networkData)
    • CloudItemStack

      @ParametersAreNullableByDefault public CloudItemStack(org.cloudburstmc.api.util.Identifier id, org.cloudburstmc.api.item.ItemType type, int amount, String itemName, List<String> itemLore, Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments, Collection<org.cloudburstmc.api.util.Identifier> canDestroy, Collection<org.cloudburstmc.api.util.Identifier> canPlaceOn, Map<Class<?>,​Object> data, com.nukkitx.nbt.NbtMap nbt, com.nukkitx.nbt.NbtMap dataTag, com.nukkitx.protocol.bedrock.data.inventory.ItemData networkData, int netId)
  • Method Details

    • getId

      public org.cloudburstmc.api.util.Identifier getId()
    • getType

      public org.cloudburstmc.api.item.ItemType getType()
      Specified by:
      getType in interface org.cloudburstmc.api.item.ItemStack
    • getAmount

      public int getAmount()
      Specified by:
      getAmount in interface org.cloudburstmc.api.item.ItemStack
    • isNull

      public boolean isNull()
      Specified by:
      isNull in interface org.cloudburstmc.api.item.ItemStack
    • getMetadataMap

      public Map<Class<?>,​Object> getMetadataMap()
    • getMetadata

      public <T> T getMetadata(Class<T> metadataClass, T defaultValue)
      Specified by:
      getMetadata in interface org.cloudburstmc.api.item.ItemStack
    • getData

      public com.google.common.collect.ImmutableMap<Class<?>,​Object> getData()
    • getName

      public String getName()
      Specified by:
      getName in interface org.cloudburstmc.api.item.ItemStack
    • getLore

      public List<String> getLore()
      Specified by:
      getLore in interface org.cloudburstmc.api.item.ItemStack
    • getEnchantments

      public Map<org.cloudburstmc.api.enchantment.EnchantmentType,​org.cloudburstmc.api.enchantment.EnchantmentInstance> getEnchantments()
      Specified by:
      getEnchantments in interface org.cloudburstmc.api.item.ItemStack
    • getCanDestroy

      public Collection<org.cloudburstmc.api.util.Identifier> getCanDestroy()
      Specified by:
      getCanDestroy in interface org.cloudburstmc.api.item.ItemStack
    • getCanPlaceOn

      public Collection<org.cloudburstmc.api.util.Identifier> getCanPlaceOn()
      Specified by:
      getCanPlaceOn in interface org.cloudburstmc.api.item.ItemStack
    • toBuilder

      public org.cloudburstmc.api.item.ItemStackBuilder toBuilder()
      Specified by:
      toBuilder in interface org.cloudburstmc.api.item.ItemStack
    • isBlock

      public boolean isBlock()
    • getNbt

      public com.nukkitx.nbt.NbtMap getNbt()
    • getNbt

      public com.nukkitx.nbt.NbtMap getNbt(boolean serialize)
    • getDataTag

      public com.nukkitx.nbt.NbtMap getDataTag()
    • getNetworkData

      public com.nukkitx.protocol.bedrock.data.inventory.ItemData getNetworkData()
    • getStackNetworkId

      public int getStackNetworkId()
    • hasTag

      public boolean hasTag()
      Specified by:
      hasTag in interface org.cloudburstmc.api.item.ItemStack
    • withData

      public org.cloudburstmc.api.item.ItemStack withData(Object data)
      Specified by:
      withData in interface org.cloudburstmc.api.item.ItemStack
    • withData

      public org.cloudburstmc.api.item.ItemStack withData(Class<?> metadataClass, Object data)
      Specified by:
      withData in interface org.cloudburstmc.api.item.ItemStack
    • getBehavior

      public org.cloudburstmc.api.item.behavior.ItemBehavior getBehavior()
      Specified by:
      getBehavior in interface org.cloudburstmc.api.item.ItemStack
    • isMergeable

      public boolean isMergeable(@Nonnull org.cloudburstmc.api.item.ItemStack other)
      Specified by:
      isMergeable in interface org.cloudburstmc.api.item.ItemStack
    • equals

      public boolean equals(@Nullable org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      equals in interface org.cloudburstmc.api.item.ItemStack
    • equals

      public boolean equals(@Nullable org.cloudburstmc.api.item.ItemStack other, boolean checkAmount, boolean checkData)
      Specified by:
      equals in interface org.cloudburstmc.api.item.ItemStack
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object