Class DepositBoxEntity
- java.lang.Object
-
- com.kraken.api.core.AbstractEntity<ContainerItem>
-
- com.kraken.api.query.container.bank.DepositBoxEntity
-
- All Implemented Interfaces:
Interactable<ContainerItem>
public class DepositBoxEntity extends AbstractEntity<ContainerItem>
-
-
Field Summary
-
Fields inherited from class com.kraken.api.core.AbstractEntity
ctx, raw
-
-
Constructor Summary
Constructors Constructor Description DepositBoxEntity(Context ctx, ContainerItem raw)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()Returns the quantity of the item in your inventory when the bank deposit box interface is open.booleandeposit()Deposits a single instance of the specified item into the bank deposit box.booleandeposit(int amount)Deposits a set amount of the given item from the players' inventory to the bank.booleandepositAll()Deposits all the given items from the players inventory into the bank deposit box.booleandepositFive()Deposits five of the given items from the players' inventory into the bank deposit box.booleandepositOne()Deposits one of the given item from the players inventory into the bank deposit box.booleandepositTen()Deposits ten of the given items from the players' inventory into the bank deposit box.booleandepositX(int amount)Deposits X amount of an item from the players inventory into the bank deposit box.intgetId()The item ID for the wrapped game entityjava.lang.StringgetName()The game entities name.booleanhasAction(java.lang.String action)Checks if the specified action is available in the inventory actions of the container item.booleaninteract(java.lang.String action)Interacts with the entity using the given action verb.-
Methods inherited from class com.kraken.api.core.AbstractEntity
equals, hashCode, isNull, raw
-
-
-
-
Constructor Detail
-
DepositBoxEntity
public DepositBoxEntity(Context ctx, ContainerItem raw)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:InteractableThe game entities name.- Returns:
- The name of the game entity i.e. NPC name for NPC's, item name for ContainerItem's, and GameObject name for various game objects.
-
interact
public boolean interact(java.lang.String action)
Description copied from interface:InteractableInteracts with the entity using the given action verb.- Parameters:
action- The menu action to trigger (e.g., "Attack", "Talk-to", "Take")- Returns:
- true if the interaction packet was successfully queued/sent
-
getId
public int getId()
Description copied from interface:InteractableThe item ID for the wrapped game entity- Returns:
- int Item id
-
count
public int count()
Returns the quantity of the item in your inventory when the bank deposit box interface is open.- Returns:
- Int the quantity of the bank inventory entity (this will be the stack size of the item if it is noted) or the value of the item if it's coins.
-
depositOne
public boolean depositOne()
Deposits one of the given item from the players inventory into the bank deposit box. This will **NOT** work for depositing equipment ifctx.depositBox().inEquipment();is used to filter the deposit box.- Returns:
- true if the deposit was successful and false otherwise.
-
depositFive
public boolean depositFive()
Deposits five of the given items from the players' inventory into the bank deposit box. This will **NOT** work for depositing equipment ifctx.depositBox().inEquipment();is used to filter the deposit box.- Returns:
- true if the deposit was successful and false otherwise.
-
depositTen
public boolean depositTen()
Deposits ten of the given items from the players' inventory into the bank deposit box. This will **NOT** work for depositing equipment ifctx.depositBox().inEquipment();is used to filter the deposit box.- Returns:
- true if the deposit was successful and false otherwise.
-
depositX
public boolean depositX(int amount)
Deposits X amount of an item from the players inventory into the bank deposit box. This will **NOT** work or depositing equipment ifctx.depositBox().inEquipment();is used to filter the deposit box.- Parameters:
amount- The amount of the item to deposit.- Returns:
- true if the deposit was successful and false otherwise.
-
depositAll
public boolean depositAll()
Deposits all the given items from the players inventory into the bank deposit box. This will **NOT** work for depositing equipment ifctx.depositBox().inEquipment();is used to filter the deposit box.- Returns:
- true if the deposit was successful and false otherwise.
-
deposit
public boolean deposit(int amount)
Deposits a set amount of the given item from the players' inventory to the bank. If the amount is not one of: 1, 5, or 10, then all the given items will be deposited by default.- Parameters:
amount- The amount of the item to deposit: 1, 5, 10, or any other integer for all the item- Returns:
- True if the deposit was successful and false otherwise
-
deposit
public boolean deposit()
Deposits a single instance of the specified item into the bank deposit box. If the instance is stackable like arrows it will deposit all arrows into the bank.This method performs different actions based on the origin of the container item:
- If the item's origin is @EQUIPMENT, it interacts with the associated widget to deposit the item.
- Otherwise, it uses the interaction manager to execute a "Deposit-1" action for the item.
- Returns:
trueif the deposit operation is executed successfully,falseotherwise.
-
hasAction
public boolean hasAction(java.lang.String action)
Checks if the specified action is available in the inventory actions of the container item.This method retrieves the item's inventory actions and verifies if any action matches the provided action string, ignoring case sensitivity.
- Parameters:
action- aStringrepresenting the name of the action to check for. It is case-insensitive, and null or empty actions are ignored.- Returns:
trueif the specified action is available in the item's inventory actions;falseotherwise.
-
-