RuneHive-Game
Loading...
Searching...
No Matches
DropViewerEvent.kt
Go to the documentation of this file.
1package org.jire.runehiveps.event.widget
2
3import com.runehive.content.DropDisplay
4import com.runehive.content.DropDisplay.DropType
5import com.runehive.game.world.entity.mob.npc.drop.NpcDropManager
6import com.runehive.game.world.entity.mob.player.Player
7
8/**
9 * @author Jire
10 */
11class DropViewerEvent(val context: String) : WidgetEvent {
12
13 override fun handle(player: Player) {
14 DropDisplay.search(player, context, DropType.NPC)
15
16 if (!player.attributes.has("DROP_DISPLAY_KEY")) return
17 val key = player.attributes.get("DROP_DISPLAY_KEY", List::class.java)
18 if (key == null || key.isEmpty()) return
19
20 DropDisplay.display(player, NpcDropManager.NPC_DROPS[key[0]])
21 player.interfaceManager.open(54500)
22 }
23
24}