From ac2ee138896e67ed7478c86df526d1af3b518ada Mon Sep 17 00:00:00 2001 From: Ceikry Date: Fri, 12 Mar 2021 23:32:32 -0600 Subject: [PATCH] Merged listener types into just InteractionListener.kt --- .../activity/allfiredup/AFUBeaconHandler.kt | 4 +- .../allfiredup/AFURepairClimbHandler.kt | 4 +- ...kt => FishingTrawlerInteractionHandler.kt} | 4 +- .../content/global/action/EquipHandler.kt | 4 +- ...tener.kt => WorkForInteractionListener.kt} | 4 +- .../bonegrinder/BoneGrinderListener.kt | 4 +- ...tionListener.kt => InteractionListener.kt} | 8 +++- .../rs09/game/interaction/UseWithListener.kt | 16 ------- .../game/interaction/city/IsafdarListeners.kt | 4 +- .../interaction/city/MorytaniaListeners.kt | 4 +- .../interaction/item/BraceletOfClayPlugin.kt | 4 +- .../item/EnchantedJewelleryListener.kt | 4 +- .../item/withobject/CoalTrucksHandler.kt | 47 ++++++++----------- .../interaction/object/DemonTauntHandler.kt | 4 +- .../interaction/object/FairyRingPlugin.kt | 4 +- .../interaction/object/GutanothChestPlugin.kt | 4 +- .../interaction/object/JungleBushHandler.kt | 4 +- .../interaction/object/MuddyChestHandler.kt | 4 +- .../interaction/object/TarBarrelListener.kt | 4 +- ...ers.kt => BarbFishInteractionListeners.kt} | 4 +- .../main/kotlin/rs09/plugin/PluginManager.kt | 10 ++-- 21 files changed, 63 insertions(+), 86 deletions(-) rename Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/{FishingTrawlerOptionHandler.kt => FishingTrawlerInteractionHandler.kt} (98%) rename Server/src/main/kotlin/rs09/game/content/jobs/{WorkForOptionListener.kt => WorkForInteractionListener.kt} (97%) rename Server/src/main/kotlin/rs09/game/interaction/{OptionListener.kt => InteractionListener.kt} (68%) delete mode 100644 Server/src/main/kotlin/rs09/game/interaction/UseWithListener.kt rename Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/{BarbFishOptionListeners.kt => BarbFishInteractionListeners.kt} (89%) diff --git a/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFUBeaconHandler.kt b/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFUBeaconHandler.kt index ae1fca2dd..f282419f6 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFUBeaconHandler.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFUBeaconHandler.kt @@ -8,7 +8,7 @@ import core.game.node.item.Item import core.game.system.task.Pulse import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.world.GameWorld private val VALID_LOGS = intArrayOf(Items.LOGS_1511, Items.OAK_LOGS_1521,Items.WILLOW_LOGS_1519,Items.MAPLE_LOGS_1517,Items.YEW_LOGS_1515,Items.MAGIC_LOGS_1513) @@ -19,7 +19,7 @@ private val LIGHT_ANIM = Animation(7307) * Handles interactions for beacons * @author Ceikry */ -class AFUBeaconListeners : OptionListener(){ +class AFUBeaconListeners : InteractionListener(){ override fun defineListeners() { on(OBJECT,"add-logs","light"){player,node -> diff --git a/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFURepairClimbHandler.kt b/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFURepairClimbHandler.kt index 32f53a530..147d5d5f5 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFURepairClimbHandler.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/allfiredup/AFURepairClimbHandler.kt @@ -9,14 +9,14 @@ import core.game.world.map.Direction import core.game.world.map.Location import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import java.util.* /** * Handles repairing and climbing of the 3 beacon shortcuts needed to access them * @author Ceikry */ -class AFURepairClimbHandler : OptionListener() { +class AFURepairClimbHandler : InteractionListener() { val repairIDs = intArrayOf(38480,38470,38494) val climbIDs = intArrayOf(38469,38471,38486,38481,38469) diff --git a/Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerOptionHandler.kt b/Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerInteractionHandler.kt similarity index 98% rename from Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerOptionHandler.kt rename to Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerInteractionHandler.kt index da5575bf2..6d0bad988 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerOptionHandler.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/fishingtrawler/FishingTrawlerInteractionHandler.kt @@ -12,7 +12,7 @@ import core.game.world.map.Location import core.game.world.update.flag.context.Animation import core.plugin.Initializable import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.node.entity.player.info.stats.FISHING_TRAWLER_LEAKS_PATCHED import rs09.game.node.entity.player.info.stats.STATS_BASE import rs09.tools.stringtools.colorize @@ -22,7 +22,7 @@ import kotlin.math.ceil * Option handler for fishing trawler * @author Ceikry */ -class FishingTrawlerOptionHandler : OptionListener() { +class FishingTrawlerInteractionHandler : InteractionListener() { val ENTRANCE_PLANK = 2178 val EXIT_PLANK = 2179 val HOLE = 2167 diff --git a/Server/src/main/kotlin/rs09/game/content/global/action/EquipHandler.kt b/Server/src/main/kotlin/rs09/game/content/global/action/EquipHandler.kt index ce586b904..9bf089404 100644 --- a/Server/src/main/kotlin/rs09/game/content/global/action/EquipHandler.kt +++ b/Server/src/main/kotlin/rs09/game/content/global/action/EquipHandler.kt @@ -10,7 +10,7 @@ import core.game.system.task.Pulse import core.game.world.map.zone.ZoneBorders import core.plugin.Plugin import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.system.config.ItemConfigParser import rs09.game.world.GameWorld @@ -19,7 +19,7 @@ import rs09.game.world.GameWorld * @author Ceikry * @author Woah */ -class EquipHandler : OptionListener() { +class EquipHandler : InteractionListener() { override fun defineListeners() { diff --git a/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt b/Server/src/main/kotlin/rs09/game/content/jobs/WorkForInteractionListener.kt similarity index 97% rename from Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt rename to Server/src/main/kotlin/rs09/game/content/jobs/WorkForInteractionListener.kt index 655a0133e..755f286a1 100644 --- a/Server/src/main/kotlin/rs09/game/content/jobs/WorkForOptionListener.kt +++ b/Server/src/main/kotlin/rs09/game/content/jobs/WorkForInteractionListener.kt @@ -7,13 +7,13 @@ import core.game.node.entity.player.Player import core.game.node.entity.player.link.diary.DiaryType import core.game.node.item.Item import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * Handles the work-for actions for the NPCs * @author Ceikry */ -class WorkForOptionListener : OptionListener() { +class WorkForInteractionListener : InteractionListener() { val possibleWeaponLooks = arrayListOf( Items.BRONZE_SCIMITAR_1321, Items.STEEL_SCIMITAR_1325, diff --git a/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt b/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt index 1dfef9287..e76378e1c 100644 --- a/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt +++ b/Server/src/main/kotlin/rs09/game/content/zone/phasmatys/bonegrinder/BoneGrinderListener.kt @@ -7,7 +7,7 @@ import core.game.system.task.Pulse import core.game.world.map.Location import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.world.GameWorld.Pulser private const val LOADER = 11162 @@ -20,7 +20,7 @@ private val FILL_ANIM = Animation(1649) private val WIND_ANIM = Animation(1648) private val SCOOP_ANIM = Animation(1650) -class BoneGrinderListener : OptionListener() { +class BoneGrinderListener : InteractionListener() { override fun defineListeners() { diff --git a/Server/src/main/kotlin/rs09/game/interaction/OptionListener.kt b/Server/src/main/kotlin/rs09/game/interaction/InteractionListener.kt similarity index 68% rename from Server/src/main/kotlin/rs09/game/interaction/OptionListener.kt rename to Server/src/main/kotlin/rs09/game/interaction/InteractionListener.kt index e122bae63..aa013661e 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/OptionListener.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/InteractionListener.kt @@ -3,7 +3,7 @@ package rs09.game.interaction import core.game.node.Node import core.game.node.entity.player.Player -abstract class OptionListener : Listener{ +abstract class InteractionListener : Listener{ val ITEM = 0 val OBJECT = 1 val NPC = 2 @@ -19,4 +19,10 @@ abstract class OptionListener : Listener{ fun on(type: Int, vararg option: String, handler: (Player, Node) -> Boolean){ Listeners.add(option,type,handler) } + fun on(used: Int, with: Int, type: Int, handler: (Player, Node, Node) -> Boolean){ + Listeners.add(used,with,type,handler) + } + fun on(type: Int,used: Int,vararg with: Int, handler: (Player, Node, Node) -> Boolean){ + Listeners.add(type,used,with,handler) + } } \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/interaction/UseWithListener.kt b/Server/src/main/kotlin/rs09/game/interaction/UseWithListener.kt deleted file mode 100644 index bdf14f9c9..000000000 --- a/Server/src/main/kotlin/rs09/game/interaction/UseWithListener.kt +++ /dev/null @@ -1,16 +0,0 @@ -package rs09.game.interaction - -import core.game.node.Node -import core.game.node.entity.player.Player - -abstract class UseWithListener : Listener { - val ITEM = 0 - val OBJECT = 1 - val NPC = 2 - fun on(used: Int, with: Int, type: Int, handler: (Player, Node, Node) -> Boolean){ - Listeners.add(used,with,type,handler) - } - fun on(type: Int,used: Int,vararg with: Int, handler: (Player, Node, Node) -> Boolean){ - Listeners.add(type,used,with,handler) - } -} \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/interaction/city/IsafdarListeners.kt b/Server/src/main/kotlin/rs09/game/interaction/city/IsafdarListeners.kt index d9d7d2cd4..f73db9b01 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/city/IsafdarListeners.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/city/IsafdarListeners.kt @@ -1,7 +1,7 @@ package rs09.game.interaction.city import core.game.world.map.Location -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * File to be used for anything Isafdar related. @@ -9,7 +9,7 @@ import rs09.game.interaction.OptionListener * @author Sir Kermit */ -class IsafdarListeners : OptionListener() { +class IsafdarListeners : InteractionListener() { val CAVE_ENTRANCE = 4006 val CAVE_EXIT = 4007 diff --git a/Server/src/main/kotlin/rs09/game/interaction/city/MorytaniaListeners.kt b/Server/src/main/kotlin/rs09/game/interaction/city/MorytaniaListeners.kt index 7bd03c1bb..68b18bf5a 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/city/MorytaniaListeners.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/city/MorytaniaListeners.kt @@ -4,7 +4,7 @@ import core.game.node.entity.impl.ForceMovement import core.game.world.map.Direction import core.game.world.map.Location import core.game.world.update.flag.context.Animation -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * File to be used for anything Morytania related. @@ -12,7 +12,7 @@ import rs09.game.interaction.OptionListener * @author Sir Kermit */ -class MorytaniaListeners : OptionListener() { +class MorytaniaListeners : InteractionListener() { val GROTTO_ENTRANCE = 3516 val GROTTO_EXIT = 3526 diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/BraceletOfClayPlugin.kt b/Server/src/main/kotlin/rs09/game/interaction/item/BraceletOfClayPlugin.kt index e1f1e6073..5998ad504 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/item/BraceletOfClayPlugin.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/item/BraceletOfClayPlugin.kt @@ -1,12 +1,12 @@ package rs09.game.interaction.item -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * Handles the bracelet of clay operate option. * @author Ceikry */ -class BraceletOfClayPlugin : OptionListener() { +class BraceletOfClayPlugin : InteractionListener() { val BRACELET = 11074 diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/EnchantedJewelleryListener.kt b/Server/src/main/kotlin/rs09/game/interaction/item/EnchantedJewelleryListener.kt index 4341cd694..b893fee71 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/item/EnchantedJewelleryListener.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/item/EnchantedJewelleryListener.kt @@ -2,14 +2,14 @@ package rs09.game.interaction.item import core.game.content.global.EnchantedJewellery import rs09.game.content.global.EnchantedJewelleryDialogueFile -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import java.util.* /** * Listener for enchanted jewellery options * @author Ceikry */ -class EnchantedJewelleryListener : OptionListener() { +class EnchantedJewelleryListener : InteractionListener() { val IDs: IntArray init { diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withobject/CoalTrucksHandler.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/CoalTrucksHandler.kt index 4dc5f6404..cd5c09981 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/item/withobject/CoalTrucksHandler.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/CoalTrucksHandler.kt @@ -4,18 +4,19 @@ import core.game.node.entity.player.link.diary.DiaryType import core.game.node.item.Item import core.game.world.map.zone.ZoneBorders import org.rs09.consts.Items -import rs09.game.interaction.OptionListener -import rs09.game.interaction.UseWithListener +import rs09.game.interaction.InteractionListener import java.util.* /** * Handles coal truck interactions * @author ceik */ -class CoalTrucksHandler : OptionListener() { +class CoalTruckInteractionListeners : InteractionListener() { val SEERS_VILLAGE_COAL_TRUCK_2114 = 2114 val seersVillageTrucks = ZoneBorders(2690,3502,2699,3508) + val COAL_TRUCK_2114 = 2114 + val COAL = Items.COAL_453 override fun defineListeners() { on(SEERS_VILLAGE_COAL_TRUCK_2114, OBJECT, "remove-coal") { player, node -> @@ -52,38 +53,28 @@ class CoalTrucksHandler : OptionListener() { player.dialogueInterpreter.sendDialogue("There is currently $coalInTruck coal in the truck.", "The truck has space for " + (120 - coalInTruck) + " more coal.") return@on true } - } - //TODO: - class CoalTruckListener : UseWithListener() { - val COAL_TRUCK_2114 = 2114 - val COAL = Items.COAL_453 + on(COAL,COAL_TRUCK_2114,OBJECT){player,_,_ -> + var coalInTruck = player.getAttribute("coal-truck-inventory", 0) - override fun defineListeners() { + var coalInInventory = player.inventory.getAmount(Items.COAL_453) - on(COAL,COAL_TRUCK_2114,OBJECT){player,_,_ -> - var coalInTruck = player.getAttribute("coal-truck-inventory", 0) + if(coalInInventory + coalInTruck >= 120){ + coalInInventory = 120 - coalInTruck + player.packetDispatch.sendMessage("You have filled up the coal truck.") - var coalInInventory = player.inventory.getAmount(Items.COAL_453) - - if(coalInInventory + coalInTruck >= 120){ - coalInInventory = 120 - coalInTruck - player.packetDispatch.sendMessage("You have filled up the coal truck.") - - //handle coal truck task for seer's village - if (!player.achievementDiaryManager.getDiary(DiaryType.SEERS_VILLAGE).isComplete(1, 2) - && player.viewport.region.id == 10294) { // region 10294 is at coal truck mine, region 10806 is in seers village - player.setAttribute("/save:diary:seers:coal-truck-full", true) - } + //handle coal truck task for seer's village + if (!player.achievementDiaryManager.getDiary(DiaryType.SEERS_VILLAGE).isComplete(1, 2) + && player.viewport.region.id == 10294) { // region 10294 is at coal truck mine, region 10806 is in seers village + player.setAttribute("/save:diary:seers:coal-truck-full", true) } - - player.inventory.remove(Item(Items.COAL_453,coalInInventory)) - coalInTruck += coalInInventory - - player.setAttribute("/save:coal-truck-inventory",coalInTruck) - return@on true } + player.inventory.remove(Item(Items.COAL_453,coalInInventory)) + coalInTruck += coalInInventory + + player.setAttribute("/save:coal-truck-inventory",coalInTruck) + return@on true } } } \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/DemonTauntHandler.kt b/Server/src/main/kotlin/rs09/game/interaction/object/DemonTauntHandler.kt index 9d8c89228..e52a99e38 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/DemonTauntHandler.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/DemonTauntHandler.kt @@ -3,14 +3,14 @@ package rs09.game.interaction.`object` import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.player.link.emote.Emotes import core.game.world.map.RegionManager -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * Handles taunting of the demon in the wizard's tower * @author afaroutdude / Ceikry */ private const val BARS = 37668 -class DemonTauntHandler : OptionListener(){ +class DemonTauntHandler : InteractionListener(){ override fun defineListeners() { on(BARS,OBJECT,"taunt-through"){player,_ -> diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/FairyRingPlugin.kt b/Server/src/main/kotlin/rs09/game/interaction/object/FairyRingPlugin.kt index ec2ed66cc..61c539a40 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/FairyRingPlugin.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/FairyRingPlugin.kt @@ -4,7 +4,7 @@ import core.game.component.Component import core.game.node.entity.player.Player import core.game.node.entity.player.link.TeleportManager.TeleportType import core.game.world.map.Location -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * Handles interactions with fairy rings @@ -15,7 +15,7 @@ private val RINGS = intArrayOf(12003, 12094, 12095, 14058, 14061, 14064, 14067, private const val MAIN_RING = 12128 -class FairyRingPlugin : OptionListener() { +class FairyRingPlugin : InteractionListener() { override fun defineListeners() { diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/GutanothChestPlugin.kt b/Server/src/main/kotlin/rs09/game/interaction/object/GutanothChestPlugin.kt index 1f7bae538..d678487d8 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/GutanothChestPlugin.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/GutanothChestPlugin.kt @@ -9,12 +9,12 @@ import core.game.node.item.Item import core.game.system.task.Pulse import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.world.GameWorld import java.util.concurrent.TimeUnit private const val CHEST = 2827 -class GutanothChestOptionHandler : OptionListener(){ +class GutanothChestInteractionHandler : InteractionListener(){ override fun defineListeners() { diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/JungleBushHandler.kt b/Server/src/main/kotlin/rs09/game/interaction/object/JungleBushHandler.kt index 4d859194e..3a92a38b7 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/JungleBushHandler.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/JungleBushHandler.kt @@ -7,14 +7,14 @@ import core.game.node.item.Item import core.game.system.task.Pulse import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener import rs09.game.world.GameWorld /** * Handles the chopping down of dense jungle, mainly to grant access to the Kharazi Jungle. * @author Ceikry */ -class JungleBushHandler : OptionListener(){ +class JungleBushHandler : InteractionListener(){ val chopped_bush = 2895 val chop_a = Animation(910) val chop_b = Animation(2382) diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/MuddyChestHandler.kt b/Server/src/main/kotlin/rs09/game/interaction/object/MuddyChestHandler.kt index 7d57fbbd7..94daaffb9 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/MuddyChestHandler.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/MuddyChestHandler.kt @@ -6,13 +6,13 @@ import core.game.node.item.GroundItemManager import core.game.node.item.Item import core.game.world.update.flag.context.Animation import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * Handles the muddy chest * @author Ceikry */ -class MuddyChestHandler : OptionListener() { +class MuddyChestHandler : InteractionListener() { private val CHEST = 170 diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/TarBarrelListener.kt b/Server/src/main/kotlin/rs09/game/interaction/object/TarBarrelListener.kt index 7dddae43f..7109a5664 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/object/TarBarrelListener.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/object/TarBarrelListener.kt @@ -4,7 +4,7 @@ import core.game.node.`object`.ObjectBuilder import core.game.node.item.Item import core.tools.RandomFunction import org.rs09.consts.Items -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener /** * @author Woah, with love @@ -15,7 +15,7 @@ import rs09.game.interaction.OptionListener * Option(s): * "Take-from" */ -class TarBarrelListener : OptionListener() { +class TarBarrelListener : InteractionListener() { val FULL_TAR_BARREL_16860 = 16860 val EMPTY_TAR_BARREL_16688 = 16688 diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishOptionListeners.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishInteractionListeners.kt similarity index 89% rename from Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishOptionListeners.kt rename to Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishInteractionListeners.kt index 02f64f548..bbe09200e 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishOptionListeners.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/fishing/barbfishing/BarbFishInteractionListeners.kt @@ -1,9 +1,9 @@ package rs09.game.node.entity.skill.fishing.barbfishing import core.game.node.item.Item -import rs09.game.interaction.OptionListener +import rs09.game.interaction.InteractionListener -class BarbFishOptionListeners : OptionListener() { +class BarbFishInteractionListeners : InteractionListener() { override fun defineListeners() { on(25268,OBJECT,"search"){player,_ -> diff --git a/Server/src/main/kotlin/rs09/plugin/PluginManager.kt b/Server/src/main/kotlin/rs09/plugin/PluginManager.kt index 6fd367112..c1ef61164 100644 --- a/Server/src/main/kotlin/rs09/plugin/PluginManager.kt +++ b/Server/src/main/kotlin/rs09/plugin/PluginManager.kt @@ -11,8 +11,7 @@ import core.plugin.PluginManifest import core.plugin.PluginType import io.github.classgraph.ClassGraph import io.github.classgraph.ClassInfo -import rs09.game.interaction.OptionListener -import rs09.game.interaction.UseWithListener +import rs09.game.interaction.InteractionListener import rs09.game.system.SystemLogger import rs09.game.system.command.Command import java.util.* @@ -73,11 +72,8 @@ object PluginManager { definePlugin(it.loadClass().newInstance() as Plugin).also { System.out.println("Initializing $it") } } catch (e: Exception) {e.printStackTrace()} } - result.getSubclasses("rs09.game.interaction.OptionListener").forEach { - (it.loadClass().newInstance() as OptionListener).defineListeners() - } - result.getSubclasses("rs09.game.interaction.UseWithListener").forEach { - (it.loadClass().newInstance() as UseWithListener).defineListeners() + result.getSubclasses("rs09.game.interaction.InteractionListener").forEach { + (it.loadClass().newInstance() as InteractionListener).defineListeners() } }