RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.itemaction.ItemActionRepository Class Reference

Handles execution of the item actions. More...

Static Public Member Functions

static void declare ()
 Declares all the item actions.
static boolean drop (Player player, Item item)
static boolean equipment (Player player, Item item, int opcode)
static boolean inventory (Player player, Item item, int opcode)
static boolean itemOnItem (Player player, Item first, Item second)

Static Public Attributes

static HashMap< Integer, ItemActionACTIONS = new HashMap<>()
 Map of all the item actions.

Detailed Description

Handles execution of the item actions.

Author
Daniel

Definition at line 14 of file ItemActionRepository.java.

Member Function Documentation

◆ declare()

void com.runehive.content.itemaction.ItemActionRepository.declare ( )
static

Declares all the item actions.

Definition at line 20 of file ItemActionRepository.java.

20 {
21 ACTIONS.put(12_931, new SerpentineHelm()); // charged
22 ACTIONS.put(12_929, new SerpentineHelm()); // uncharged
23
24 ACTIONS.put(13_196, new TanzaniteHelm()); // charged
25 ACTIONS.put(13_197, new TanzaniteHelm()); // uncharged
26
27 ACTIONS.put(13_198, new MagmaHelm()); // charged
28 ACTIONS.put(13_199, new MagmaHelm()); // uncharged
29
30 ACTIONS.put(11283, new DragonfireShield()); // charged
31 ACTIONS.put(11284, new DragonfireShield()); // uncharged
32
33 ACTIONS.put(12924, new ToxicBlowpipe()); // uncharged
34 ACTIONS.put(12926, new ToxicBlowpipe()); // charged
35
36 ACTIONS.put(11907, new TridentOfTheSeas()); // charged
37 ACTIONS.put(12899, new TridentOfTheSwamp()); // charged
38
39
40 ACTIONS.put((int) CrawsBow.CRAWS_UNCHARGED_ID, new CrawsBow()); // uncharged
41 ACTIONS.put((int) CrawsBow.CRAWS_CHARGED_ID, new CrawsBow()); // charged
42
43 ACTIONS.put((int) ViggorasChainmace.VIGGORAS_CHAINMACE_UNCHARGED_ID, new ViggorasChainmace()); // uncharged
44 ACTIONS.put((int) ViggorasChainmace.VIGGORAS_CHAINMACE_CHARGED_ID, new ViggorasChainmace()); // charged
45
46 ACTIONS.put((int) ThammaronsSceptre.THAMMARONS_SCEPTRE_UNCHARGED_ID, new ThammaronsSceptre()); // uncharged
47 ACTIONS.put((int) ThammaronsSceptre.THAMMARONS_SCEPTRE_CHARGED_ID, new ThammaronsSceptre()); // charged
48
49 ACTIONS.put((int) CelestialRing.UNCHARGED_RING, new CelestialRing()); // uncharged
50 ACTIONS.put((int) CelestialRing.CHARGED_RING, new CelestialRing()); // charged
51
52 ACTIONS.put(6831, new MimeBox());
53 ACTIONS.put(6832, new DrillDemonBox());
54 ACTIONS.put(12897, new ClanShowcaseBox());
55 ACTIONS.put(6854, new ClanResourceBox());
56
57// ACTIONS.put(1704, new AmuletOfGlory());
58// ACTIONS.put(1706, new AmuletOfGlory());
59// ACTIONS.put(1708, new AmuletOfGlory());
60// ACTIONS.put(1710, new AmuletOfGlory());
61// ACTIONS.put(1712, new AmuletOfGlory());
62// ACTIONS.put(1714, new AmuletOfGlory());
63// ACTIONS.put(11978, new AmuletOfGlory());
64// ACTIONS.put(11978, new AmuletOfGlory());
65// ACTIONS.put(2566, new RingOfDueling());
66// ACTIONS.put(2564, new RingOfDueling());
67// ACTIONS.put(2562, new RingOfDueling());
68// ACTIONS.put(2560, new RingOfDueling());
69// ACTIONS.put(2558, new RingOfDueling());
70// ACTIONS.put(2556, new RingOfDueling());
71// ACTIONS.put(2554, new RingOfDueling());
72// ACTIONS.put(2552, new RingOfDueling());
73 }

References ACTIONS, com.runehive.content.itemaction.impl.CelestialRing.CHARGED_RING, com.runehive.content.itemaction.impl.CrawsBow.CRAWS_CHARGED_ID, com.runehive.content.itemaction.impl.CrawsBow.CRAWS_UNCHARGED_ID, com.runehive.content.itemaction.impl.ThammaronsSceptre.THAMMARONS_SCEPTRE_CHARGED_ID, com.runehive.content.itemaction.impl.ThammaronsSceptre.THAMMARONS_SCEPTRE_UNCHARGED_ID, com.runehive.content.itemaction.impl.CelestialRing.UNCHARGED_RING, com.runehive.content.itemaction.impl.ViggorasChainmace.VIGGORAS_CHAINMACE_CHARGED_ID, and com.runehive.content.itemaction.impl.ViggorasChainmace.VIGGORAS_CHAINMACE_UNCHARGED_ID.

Referenced by com.runehive.RuneHive.processParallelStartupTasks().

Here is the caller graph for this function:

◆ drop()

boolean com.runehive.content.itemaction.ItemActionRepository.drop ( Player player,
Item item )
static

Definition at line 90 of file ItemActionRepository.java.

90 {
91 ItemAction action = ACTIONS.get(item.getId());
92 return action != null && action.drop(player, item);
93 }
boolean drop(Player player, Item item)
final int getId()
Gets the identification of this item.
Definition Item.java:324

References ACTIONS, com.runehive.content.itemaction.ItemAction.drop(), and com.runehive.game.world.items.Item.getId().

Referenced by com.runehive.net.packet.in.DropItemPacketListener.handlePacket().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ equipment()

boolean com.runehive.content.itemaction.ItemActionRepository.equipment ( Player player,
Item item,
int opcode )
static

Definition at line 85 of file ItemActionRepository.java.

85 {
86 ItemAction action = ACTIONS.get(item.getId());
87 return action != null && action.equipment(player, item, opcode);
88 }
boolean equipment(Player player, Item item, int opcode)

References ACTIONS, com.runehive.content.itemaction.ItemAction.equipment(), and com.runehive.game.world.items.Item.getId().

Here is the call graph for this function:

◆ inventory()

boolean com.runehive.content.itemaction.ItemActionRepository.inventory ( Player player,
Item item,
int opcode )
static

Definition at line 80 of file ItemActionRepository.java.

80 {
81 ItemAction action = ACTIONS.get(item.getId());
82 return action != null && action.inventory(player, item, opcode);
83 }
boolean inventory(Player player, Item item, int opcode)
The execution method of the action.

References ACTIONS, com.runehive.game.world.items.Item.getId(), and com.runehive.content.itemaction.ItemAction.inventory().

Referenced by com.runehive.net.packet.in.ItemOptionPacketListener.handleFirstOption(), com.runehive.net.packet.in.ItemOptionPacketListener.handleSecondOption(), and com.runehive.net.packet.in.ItemOptionPacketListener.handleThirdOption().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ itemOnItem()

boolean com.runehive.content.itemaction.ItemActionRepository.itemOnItem ( Player player,
Item first,
Item second )
static

Definition at line 75 of file ItemActionRepository.java.

75 {
76 ItemAction action = ACTIONS.getOrDefault(first.getId(), ACTIONS.get(second.getId()));
77 return action != null && action.itemOnItem(player, first, second);
78 }
boolean itemOnItem(Player player, Item first, Item second)

References ACTIONS, com.runehive.game.world.items.Item.getId(), and com.runehive.content.itemaction.ItemAction.itemOnItem().

Referenced by com.runehive.net.packet.in.UseItemPacketListener.handleItemOnItem().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ACTIONS

HashMap<Integer, ItemAction> com.runehive.content.itemaction.ItemActionRepository.ACTIONS = new HashMap<>()
static

Map of all the item actions.

Definition at line 17 of file ItemActionRepository.java.

Referenced by declare(), drop(), equipment(), inventory(), and itemOnItem().


The documentation for this class was generated from the following file: