Package org.cloudburstmc.server.item
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,RecipeItemStack
@Immutable
@ParametersAreNonnullByDefault
public class CloudItemStack
extends Object
implements org.cloudburstmc.api.item.ItemStack
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Set<org.cloudburstmc.api.util.Identifier>protected Set<org.cloudburstmc.api.util.Identifier>protected com.nukkitx.nbt.NbtMapprotected com.google.common.collect.ImmutableMap<org.cloudburstmc.api.enchantment.EnchantmentType,org.cloudburstmc.api.enchantment.EnchantmentInstance>protected org.cloudburstmc.api.util.Identifierprotected Stringprotected com.nukkitx.nbt.NbtMapprotected com.nukkitx.protocol.bedrock.data.inventory.ItemDataprotected static Objectprotected intprotected org.cloudburstmc.api.item.ItemTypeFields inherited from interface org.cloudburstmc.api.item.ItemStack
registry -
Constructor Summary
ConstructorsConstructorDescriptionCloudItemStack(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 TypeMethodDescriptionbooleanbooleanequals(org.cloudburstmc.api.item.ItemStack item)booleanequals(org.cloudburstmc.api.item.ItemStack other, boolean checkAmount, boolean checkData)intorg.cloudburstmc.api.item.behavior.ItemBehaviorCollection<org.cloudburstmc.api.util.Identifier>Collection<org.cloudburstmc.api.util.Identifier>getData()com.nukkitx.nbt.NbtMapMap<org.cloudburstmc.api.enchantment.EnchantmentType,org.cloudburstmc.api.enchantment.EnchantmentInstance>org.cloudburstmc.api.util.IdentifiergetId()getLore()<T> TgetMetadata(Class<T> metadataClass, T defaultValue)getName()com.nukkitx.nbt.NbtMapgetNbt()com.nukkitx.protocol.bedrock.data.inventory.ItemDataintorg.cloudburstmc.api.item.ItemTypegetType()inthashCode()booleanhasTag()booleanisMergeable(org.cloudburstmc.api.item.ItemStack other)booleanisNull()org.cloudburstmc.api.item.ItemStackBuilderorg.cloudburstmc.api.item.ItemStackorg.cloudburstmc.api.item.ItemStackMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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
-
id
protected volatile org.cloudburstmc.api.util.Identifier id -
type
protected final org.cloudburstmc.api.item.ItemType type -
amount
protected final int amount -
itemName
-
itemLore
-
enchantments
protected final com.google.common.collect.ImmutableMap<org.cloudburstmc.api.enchantment.EnchantmentType,org.cloudburstmc.api.enchantment.EnchantmentInstance> enchantments -
canDestroy
-
canPlaceOn
-
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:
getTypein interfaceorg.cloudburstmc.api.item.ItemStack
-
getAmount
public int getAmount()- Specified by:
getAmountin interfaceorg.cloudburstmc.api.item.ItemStack
-
isNull
public boolean isNull()- Specified by:
isNullin interfaceorg.cloudburstmc.api.item.ItemStack
-
getMetadata
- Specified by:
getMetadatain interfaceorg.cloudburstmc.api.item.ItemStack
-
getData
-
getName
- Specified by:
getNamein interfaceorg.cloudburstmc.api.item.ItemStack
-
getLore
- Specified by:
getLorein interfaceorg.cloudburstmc.api.item.ItemStack
-
getEnchantments
public Map<org.cloudburstmc.api.enchantment.EnchantmentType,org.cloudburstmc.api.enchantment.EnchantmentInstance> getEnchantments()- Specified by:
getEnchantmentsin interfaceorg.cloudburstmc.api.item.ItemStack
-
getCanDestroy
- Specified by:
getCanDestroyin interfaceorg.cloudburstmc.api.item.ItemStack
-
getCanPlaceOn
- Specified by:
getCanPlaceOnin interfaceorg.cloudburstmc.api.item.ItemStack
-
toBuilder
public org.cloudburstmc.api.item.ItemStackBuilder toBuilder()- Specified by:
toBuilderin interfaceorg.cloudburstmc.api.item.ItemStack
-
getNbt
public com.nukkitx.nbt.NbtMap getNbt() -
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:
hasTagin interfaceorg.cloudburstmc.api.item.ItemStack
-
withData
- Specified by:
withDatain interfaceorg.cloudburstmc.api.item.ItemStack
-
withData
- Specified by:
withDatain interfaceorg.cloudburstmc.api.item.ItemStack
-
getBehavior
public org.cloudburstmc.api.item.behavior.ItemBehavior getBehavior()- Specified by:
getBehaviorin interfaceorg.cloudburstmc.api.item.ItemStack
-
isMergeable
public boolean isMergeable(@Nonnull org.cloudburstmc.api.item.ItemStack other)- Specified by:
isMergeablein interfaceorg.cloudburstmc.api.item.ItemStack
-
equals
public boolean equals(@Nullable org.cloudburstmc.api.item.ItemStack item)- Specified by:
equalsin interfaceorg.cloudburstmc.api.item.ItemStack
-
equals
public boolean equals(@Nullable org.cloudburstmc.api.item.ItemStack other, boolean checkAmount, boolean checkData)- Specified by:
equalsin interfaceorg.cloudburstmc.api.item.ItemStack
-
equals
-
hashCode
public int hashCode()
-