public class ItemStack implements NetworkSerializable
Class ItemStack. Provides itemstack functionality for the Hytale server.
java.lang.Object > ItemStack
Field Summary
itemId
Field itemId.
quantity
Field quantity.
durability
Field durability.
maxDurability
Field maxDurability.
overrideDroppedItemAnimation
Field overrideDroppedItemAnimation.
metadata
Field metadata.
cachedPacket
Field cachedPacket.
item
Field item.
newItemId
Field newItemId.
bsonValue
Field bsonValue.
empty
Field empty.
clonedMeta
Field clonedMeta.
packet
Field packet.
itemStack
Field itemStack.
Method Detail
ItemStack
public
ItemStack
(@Nonnull final String itemId, final int quantity, @Nullable final BsonDocument metadata)
Method ItemStack.
- Parameters:
@Nonnull final StringitemIdfinal intquantity@Nullable final BsonDocumentmetadata
IllegalArgumentException
new
IllegalArgumentException
(String.format("quantity %s must be >0!", quantity)
Method IllegalArgumentException.
- Parameters:
String.format("quantity %s must be >0!",quantity
getItemId
String
getItemId
()
Method getItemId.
getQuantity
int
getQuantity
()
Method getQuantity.
getMetadata
BsonDocument
getMetadata
()
Method getMetadata.
isUnbreakable
boolean
isUnbreakable
()
Method isUnbreakable.
isBroken
boolean
isBroken
()
Method isBroken.
getMaxDurability
double
getMaxDurability
()
Method getMaxDurability.
getDurability
double
getDurability
()
Method getDurability.
isEmpty
boolean
isEmpty
()
Method isEmpty.
getOverrideDroppedItemAnimation
boolean
getOverrideDroppedItemAnimation
()
Method getOverrideDroppedItemAnimation.
setOverrideDroppedItemAnimation
void
setOverrideDroppedItemAnimation
(final boolean b)
Method setOverrideDroppedItemAnimation.
- Parameters:
final booleanb
getBlockKey
String
getBlockKey
()
Method getBlockKey.
isValid
boolean
isValid
()
Method isValid.
withDurability
Method withDurability.
- Parameters:
final doubledurability
withMaxDurability
Method withMaxDurability.
- Parameters:
final doublemaxDurability
withIncreasedDurability
Method withIncreasedDurability.
- Parameters:
final doubleinc
withRestoredDurability
Method withRestoredDurability.
- Parameters:
final doublemaxDurability
withState
Method withState.
- Parameters:
@Nonnull final Stringstate
withQuantity
Method withQuantity.
- Parameters:
final intquantity
withMetadata
Method withMetadata.
- Parameters:
@Nullable final BsonDocumentmetadata
BsonDocument
new
BsonDocument
()
Method BsonDocument.
getFromMetadataOrNull
Method getFromMetadataOrNull.
- Parameters:
@Nonnull final KeyedCodeckeyedCodec
getFromMetadataOrDefault
Method getFromMetadataOrDefault.
- Parameters:
@Nonnull final Stringkey@Nonnull final BuilderCodeccodec
equals
boolean
equals
(@Nullable final Object o)
Method equals.
- Parameters:
@Nullable final Objecto
hashCode
int
hashCode
()
Method hashCode.
toString
String
toString
()
Method toString.
isSameItemType
Method isSameItemType.
- Parameters:
@Nullable final ItemStacka@Nullable final ItemStackb