Class Item
java.lang.Object
ActiverseEngine.Item
Represents an item in the Activerse game engine.
Each item has a name, type, and value.
- Version:
- 1.4.1
- Author:
- Knivier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this item can stack with another itemgetName()Returns the name of the itemgetType()For implementationintgetValue()Returns the value as signed and serialized of type itemvoidsetValue(int value) Sets the value of the item (for stacking, quantity changes, etc.)booleanStacks another item with this one by adding quantitiestoString()abstract voiduse()Action that the item does to something
-
Constructor Details
-
Item
-
-
Method Details
-
getName
-
getType
-
getValue
public int getValue()Returns the value as signed and serialized of type item- Returns:
- Value none defined
-
setValue
public void setValue(int value) Sets the value of the item (for stacking, quantity changes, etc.)- Parameters:
value- The new value to set
-
canStack
Checks if this item can stack with another item- Parameters:
other- The other item to check- Returns:
- true if items can be stacked together
-
stack
Stacks another item with this one by adding quantities- Parameters:
other- The item to stack with this one- Returns:
- true if stacking was successful
-
toString
-
use
public abstract void use()Action that the item does to something
-