1package com.runehive.content.skill.impl.magic;
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.items.Item;
5import com.runehive.game.world.position.Area;
6import com.runehive.net.packet.out.SendItemOnInterface;
7import com.runehive.util.Utility;
9import java.util.LinkedList;
33 public List<Item>
runes =
new LinkedList<>();
42 player.interfaceManager.open(41700);
67 if (rune.getId() == item) {
68 int current =
player.inventory.computeAmountForId(item);
69 if (rune.getAmount() - amount < 0) amount = rune.getAmount();
70 player.inventory.add(item, amount);
71 int newAm =
player.inventory.computeAmountForId(item);
72 if (newAm - current < amount) amount = newAm - current;
73 rune.decrementAmountBy(amount);
74 if (rune.getAmount() == 0)
83 boolean allowed =
false;
85 if (rune.getId() == item.
getId()) {
91 player.message(
"You can only deposit runes into the rune pouch!");
96 if (item.
getId() == rune.getId()) {
102 rune.incrementAmountBy(amount);
108 if (
runes.size() >= 3) {
109 player.message(
"Your rune pouch is currently full and can not hold any more types of runes!");
126 amount += rune.getAmount();
134 if (rune.getId() ==
id)
135 amount += rune.getAmount();
142 if (rune.getId() == item.
getId() && rune.getAmount() >= item.
getAmount())
150 if (rune.getId() == item)
156 public void remove(
Item item) {
158 if (rune.equalIds(item)) {
159 rune.decrementAmountBy(item.getAmount());
160 if (rune.getAmount() == 0)
int getRuneAmount(int id)
boolean contains(Item item)
List< Item > runes
The runes stores in the rune pouch;.
RunePouch(Player player)
Constructs a new RunePouch.
static final int MAXIMUM_RUNE_CAPACITY
The maximum amount of total runes the player can carry in their rune pouch.
boolean containsId(int item)
void withdraw(int item, int amount)
void deposit(Item item, int amount)
final Item[] ALLOWED_RUNES
Array of all runes allowed to be inside the rune pouch.
final Player player
The player instance.
This class represents a character controlled by a player.
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
final int getAmount()
Gets the quantity of this item.
Handles checking if mobs are in a certain area.
static boolean inWilderness(Position position)
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.