Class ItemStack
java.lang.Object
com.github.retrooper.packetevents.protocol.item.ItemStack
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ItemStack.Builder
builder()
boolean
copy()
static ItemStack
decode
(NBT nbt, ClientVersion version) static NBT
encodeForParticle
(ItemStack itemStack, ClientVersion version) boolean
int
<T> Optional
<T> getComponent
(ComponentType<T> type) <T> T
getComponentOr
(ComponentType<T> type, T otherValue) int
int
getEnchantmentLevel
(EnchantmentType enchantment, ClientVersion version) getEnchantments
(ClientVersion version) getEnchantmentsTagName
(ClientVersion version) Deprecated.int
int
int
@Nullable NBTCompound
getNBT()
getType()
void
grow
(int amount) boolean
hasComponent
(ComponentType<?> type) boolean
boolean
boolean
boolean
boolean
isEmpty()
boolean
isEnchantable
(ClientVersion version) boolean
isEnchanted
(ClientVersion version) static boolean
isSameItemSameTags
(ItemStack stack, ItemStack otherStack) boolean
void
setAmount
(int amount) <T> void
setComponent
(ComponentType<T> type, Optional<T> value) <T> void
setComponent
(ComponentType<T> type, T value) void
setComponents
(@Nullable PatchableComponentMap components) void
setDamageValue
(int damage) void
setEnchantments
(List<Enchantment> enchantments, ClientVersion version) void
setLegacyData
(int legacyData) void
setNBT
(NBTCompound nbt) void
shrink
(int amount) split
(int toTake) static boolean
tagMatches
(ItemStack left, ItemStack right) toString()
<T> void
unsetComponent
(ComponentType<T> type)
-
Field Details
-
EMPTY
-
-
Method Details
-
decode
-
encodeForParticle
-
getMaxStackSize
public int getMaxStackSize() -
isStackable
public boolean isStackable() -
isDamageableItem
public boolean isDamageableItem() -
isDamaged
public boolean isDamaged() -
getDamageValue
public int getDamageValue() -
setDamageValue
public void setDamageValue(int damage) -
getMaxDamage
public int getMaxDamage() -
getOrCreateTag
-
getType
-
getAmount
public int getAmount() -
shrink
public void shrink(int amount) -
grow
public void grow(int amount) -
setAmount
public void setAmount(int amount) -
split
-
copy
-
getNBT
-
setNBT
-
getComponentOr
-
getComponent
-
setComponent
-
unsetComponent
-
setComponent
-
hasComponent
-
hasComponentPatches
public boolean hasComponentPatches() -
getComponents
-
setComponents
- Parameters:
components
- if set null will reset to components ofItemType
-
getLegacyData
public int getLegacyData() -
setLegacyData
public void setLegacyData(int legacyData) -
isEnchantable
-
isEnchanted
-
getEnchantments
-
getEnchantmentLevel
-
setEnchantments
-
getEnchantmentsTagName
Deprecated. -
canBeDepleted
public boolean canBeDepleted() -
is
-
isSameItemSameTags
-
tagMatches
-
equals
-
toString
-
isEmpty
public boolean isEmpty() -
builder
-