Class ItemStack
java.lang.Object
com.hypixel.hytale.server.core.inventory.ItemStack
- All Implemented Interfaces:
NetworkSerializable<ItemWithAllMetadata>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ItemWithAllMetadatastatic final BuilderCodec<ItemStack> protected doublestatic final ItemStackstatic final ItemStack[]protected Stringprotected doubleprotected org.bson.BsonDocumentprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ItemStackfromPacket(ItemQuantity packet) double<T> TgetFromMetadataOrDefault(String key, BuilderCodec<T> codec) <T> TgetFromMetadataOrNull(KeyedCodec<T> keyedCodec) <T> TgetFromMetadataOrNull(String key, Codec<T> codec) getItem()doubleorg.bson.BsonDocumentDeprecated.booleanintinthashCode()booleanisBroken()booleanisEmpty()static booleanbooleanisEquivalentType(ItemStack itemStack) static booleanstatic booleanisSameItemType(ItemStack a, ItemStack b) booleanisStackableWith(ItemStack itemStack) static booleanbooleanbooleanisValid()voidsetOverrideDroppedItemAnimation(boolean b) toPacket()toString()withDurability(double durability) withIncreasedDurability(double inc) withMaxDurability(double maxDurability) <T> ItemStackwithMetadata(KeyedCodec<T> keyedCodec, T data) <T> ItemStackwithMetadata(String key, Codec<T> codec, T data) withMetadata(String key, org.bson.BsonValue bsonValue) withMetadata(org.bson.BsonDocument metadata) withQuantity(int quantity) withRestoredDurability(double maxDurability)
-
Field Details
-
EMPTY_ARRAY
-
CODEC
-
EMPTY
-
itemId
-
quantity
protected int quantity -
durability
protected double durability -
maxDurability
protected double maxDurability -
overrideDroppedItemAnimation
protected boolean overrideDroppedItemAnimation -
metadata
@Nullable protected org.bson.BsonDocument metadata -
cachedPacket
-
-
Constructor Details
-
ItemStack
-
ItemStack
public ItemStack(@Nonnull String itemId, int quantity, double durability, double maxDurability, @Nullable org.bson.BsonDocument metadata) -
ItemStack
-
ItemStack
-
ItemStack
protected ItemStack()
-
-
Method Details
-
getItemId
-
getQuantity
public int getQuantity() -
getMetadata
Deprecated. -
isUnbreakable
public boolean isUnbreakable() -
isBroken
public boolean isBroken() -
getMaxDurability
public double getMaxDurability() -
getDurability
public double getDurability() -
isEmpty
public boolean isEmpty() -
getOverrideDroppedItemAnimation
public boolean getOverrideDroppedItemAnimation() -
setOverrideDroppedItemAnimation
public void setOverrideDroppedItemAnimation(boolean b) -
getBlockKey
-
getItem
-
isValid
public boolean isValid() -
withDurability
-
withMaxDurability
-
withIncreasedDurability
-
withRestoredDurability
-
withState
-
withQuantity
-
withMetadata
-
withMetadata
-
withMetadata
-
withMetadata
-
toPacket
- Specified by:
toPacketin interfaceNetworkSerializable<ItemWithAllMetadata>
-
isStackableWith
-
isEquivalentType
-
getFromMetadataOrNull
-
getFromMetadataOrNull
-
getFromMetadataOrDefault
-
equals
-
hashCode
public int hashCode() -
toString
-
isEmpty
-
isStackableWith
-
isEquivalentType
-
isSameItemType
-
fromPacket
-