From f5e99d5cb1ef3530facc7e81874936b94f2ab64e Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 May 2020 14:42:01 -0400 Subject: [PATCH 1/9] plugin manager: chain child injectors for plugin dependencies Instead of combining the modules of the plugin and all of it dependencies, create a new child injector for the plugin from a child injector comprised of the parent module(s) --- .../client/plugins/PluginManager.java | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java index 5dd3c6b231..8b31d4a201 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java @@ -478,21 +478,39 @@ public class PluginManager try { - Module pluginModule = (Binder binder) -> + Injector parent = RuneLite.getInjector(); + + if (deps.size() > 1) { - binder.bind(clazz).toInstance(plugin); - binder.install(plugin); + List modules = new ArrayList<>(deps.size()); for (Plugin p : deps) { - Module p2 = (Binder binder2) -> + // Create a module for each dependency + Module module = (Binder binder) -> { - binder2.bind((Class) p.getClass()).toInstance(p); - binder2.install(p); + binder.bind((Class) p.getClass()).toInstance(p); + binder.install(p); }; - binder.install(p2); + modules.add(module); } + + // Create a parent injector containing all of the dependencies + parent = parent.createChildInjector(modules); + } + else if (!deps.isEmpty()) + { + // With only one dependency we can simply use its injector + parent = deps.get(0).injector; + } + + // Create injector for the module + Module pluginModule = (Binder binder) -> + { + // Since the plugin itself is a module, it won't bind itself, so we'll bind it here + binder.bind(clazz).toInstance(plugin); + binder.install(plugin); }; - Injector pluginInjector = RuneLite.getInjector().createChildInjector(pluginModule); + Injector pluginInjector = parent.createChildInjector(pluginModule); pluginInjector.injectMembers(plugin); plugin.injector = pluginInjector; } From 7de65bbcf42c9a7a3365a342c3f8acdd37db97f4 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 May 2020 14:45:22 -0400 Subject: [PATCH 2/9] plugin manager: don't search child injector bindings for configs This fixes plugins which have dependencies and no configuration from erronously having their deps config picked up, and also fixes defaults being applied multiple times to the same config on startup due to the configs being in the bindings of multiple injectors --- .../main/java/net/runelite/client/plugins/PluginManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java index 8b31d4a201..1a2dc1f365 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/PluginManager.java @@ -164,7 +164,7 @@ public class PluginManager { final Injector injector = plugin.getInjector(); - for (Key key : injector.getAllBindings().keySet()) + for (Key key : injector.getBindings().keySet()) { Class type = key.getTypeLiteral().getRawType(); if (Config.class.isAssignableFrom(type)) @@ -197,7 +197,7 @@ public class PluginManager List list = new ArrayList<>(); for (Injector injector : injectors) { - for (Key key : injector.getAllBindings().keySet()) + for (Key key : injector.getBindings().keySet()) { Class type = key.getTypeLiteral().getRawType(); if (Config.class.isAssignableFrom(type)) From 08b0a10c84b494c56193195e078e956b9db036b1 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Fri, 29 May 2020 01:19:04 -0400 Subject: [PATCH 3/9] grounditems: Fix grammar in config descriptions (#11743) --- .../client/plugins/grounditems/GroundItemsConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java index 555da9cd4a..c00bbf5e22 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java @@ -111,7 +111,7 @@ public interface GroundItemsConfig extends Config @ConfigItem( keyName = "recolorMenuHiddenItems", name = "Recolor Menu Hidden Items", - description = "Configures whether or not hidden items in right click menu will be recolored", + description = "Configures whether or not hidden items in right-click menu will be recolored", position = 5 ) default boolean recolorMenuHiddenItems() @@ -144,7 +144,7 @@ public interface GroundItemsConfig extends Config @ConfigItem( keyName = "notifyTier", name = "Notify >= Tier", - description = "Configures what tier of highlight will cause a drop", + description = "Configures which price tiers will trigger a notification on drop", position = 8 ) default HighlightTier notifyTier() @@ -155,7 +155,7 @@ public interface GroundItemsConfig extends Config @ConfigItem( keyName = "priceDisplayMode", name = "Price Display Mode", - description = "Configures what price types are shown alongside of ground item name", + description = "Configures which price types are shown alongside ground item name", position = 9 ) default PriceDisplayMode priceDisplayMode() From 2f64651f313809d30c8e644b1efaa1b0079beb1b Mon Sep 17 00:00:00 2001 From: Rangvaldr <47463740+rangvaldr@users.noreply.github.com> Date: Fri, 29 May 2020 02:00:14 -0400 Subject: [PATCH 4/9] AgilityShortcut: Add Witchaven Dungeon agility shortcut (#11690) --- .../main/java/net/runelite/client/game/AgilityShortcut.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java index b8fd8ec89a..abee41698c 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java +++ b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java @@ -67,7 +67,9 @@ public enum AgilityShortcut // Fossil Island Wyvern Cave STAIRS_31485, // Trollweiss Mountain Cave - ROCKY_HANDHOLDS, ROCKY_HANDHOLDS_19847), + ROCKY_HANDHOLDS, ROCKY_HANDHOLDS_19847, + // Witchaven Dungeon + SHORTCUT), BRIMHAVEN_DUNGEON_MEDIUM_PIPE_RETURN(1, "Pipe Squeeze", null, new WorldPoint(2698, 9491, 0), PIPE_21727), BRIMHAVEN_DUNGEON_PIPE_RETURN(1, "Pipe Squeeze", null, new WorldPoint(2655, 9573, 0), PIPE_21728), BRIMHAVEN_DUNGEON_STEPPING_STONES_RETURN(1, "Pipe Squeeze", null, STEPPING_STONE_21739), From 3a435921a7b4249c5b6525d73cb1f238c76c4920 Mon Sep 17 00:00:00 2001 From: Crow <40111569+000000653@users.noreply.github.com> Date: Fri, 29 May 2020 01:03:40 -0500 Subject: [PATCH 5/9] skillcalculator: Add divine potions to herblore calculator (#11676) --- .../skillcalculator/skill_herblore.json | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json index 93e0ed258c..650945b8d8 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json @@ -246,6 +246,24 @@ "name": "Antifire Potion (3)", "xp": 157.5 }, + { + "level": 70, + "icon": 23697, + "name": "Divine super attack potion(4)", + "xp:": 2 + }, + { + "level": 70, + "icon": 23721, + "name": "Divine super defence potion(4)", + "xp:": 2 + }, + { + "level": 70, + "icon": 23709, + "name": "Divine super strength potion(4)", + "xp:": 2 + }, { "level": 70, "icon": 267, @@ -264,6 +282,12 @@ "name": "Weapon Poison (+)", "xp": 165 }, + { + "level": 74, + "icon": 23733, + "name": "Divine ranging potion(4)", + "xp:": 2 + }, { "level": 75, "icon": 269, @@ -288,6 +312,12 @@ "name": "Stamina Potion (4)", "xp": 102 }, + { + "level": 78, + "icon": 23745, + "name": "Divine magic potion(4)", + "xp:": 2 + }, { "level": 78, "icon": 189, @@ -330,6 +360,18 @@ "name": "Extended Antifire (3)", "xp": 82.5 }, + { + "level": 86, + "icon": 24635, + "name": "Divine bastion potion(4)", + "xp:": 2 + }, + { + "level": 86, + "icon": 24623, + "name": "Divine battlemage potion(4)", + "xp:": 2 + }, { "level": 87, "icon": 12907, @@ -354,6 +396,12 @@ "name": "Anti-venom+(3)", "xp": 125 }, + { + "level": 97, + "icon": 23685, + "name": "Divine super combat potion(4)", + "xp:": 2 + }, { "level": 98, "icon": 21981, From ed64fcadd782c73fc48ff518786caa8522262697 Mon Sep 17 00:00:00 2001 From: SomeZer0 <37823182+SomeZer0@users.noreply.github.com> Date: Fri, 29 May 2020 01:09:00 -0500 Subject: [PATCH 6/9] boosts: Improve "Boost amount threshold" config description (#11744) --- .../java/net/runelite/client/plugins/boosts/BoostsConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java index 5c9111bc06..dbb0d6d731 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/BoostsConfig.java @@ -104,7 +104,7 @@ public interface BoostsConfig extends Config @ConfigItem( keyName = "boostThreshold", name = "Boost amount threshold", - description = "The amount of levels boosted to display then in different color. A value of 0 will disable the feature.", + description = "The threshold at which boosted levels will be displayed in a different color. A value of 0 will disable the feature.", position = 6 ) default int boostThreshold() From d2286f18b0097ebed9b03098bee1b7740d6f446f Mon Sep 17 00:00:00 2001 From: while-loop Date: Thu, 28 May 2020 14:02:21 -0400 Subject: [PATCH 7/9] chat-history: fix plugin not clearing history --- .../runelite/client/plugins/chathistory/ChatHistoryPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java index bf454cf9bb..8305c40bde 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java @@ -254,7 +254,8 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener { final String menuOption = event.getMenuOption(); - if (CLEAR_HISTORY.equals(menuOption)) + // The menu option for clear history is "Public: Clear history" + if (menuOption.endsWith(CLEAR_HISTORY)) { clearChatboxHistory(ChatboxTab.of(event.getWidgetId())); } From 6d3f7ebee004197350a92f055f1f28eefb95fce1 Mon Sep 17 00:00:00 2001 From: oneilljos Date: Fri, 29 May 2020 15:40:39 -0400 Subject: [PATCH 8/9] grounditems: Remove duplicate item count in notifications (#10526) --- .../client/plugins/grounditems/GroundItemsPlugin.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 2f258d152d..96e461ef48 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -650,9 +650,6 @@ public class GroundItemsPlugin extends Plugin if (item.getQuantity() > 1) { - notificationStringBuilder.append(" x ").append(item.getQuantity()); - - if (item.getQuantity() > (int) Character.MAX_VALUE) { notificationStringBuilder.append(" (Lots!)"); @@ -664,8 +661,7 @@ public class GroundItemsPlugin extends Plugin .append(")"); } } - - notificationStringBuilder.append("!"); + notifier.notify(notificationStringBuilder.toString()); } From 8d4d974dc55ca95d388e96d73080943386a75df9 Mon Sep 17 00:00:00 2001 From: branisk <56201891+branisk@users.noreply.github.com> Date: Fri, 29 May 2020 18:44:05 -0400 Subject: [PATCH 9/9] worldmap: Fix Kebos Lowlands mining site tooltip (#11748) --- .../runelite/client/plugins/worldmap/MiningSiteLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java index 405e08488d..ff777d0f4f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java @@ -118,7 +118,7 @@ enum MiningSiteLocation new Rock(1, Ore.IRON), new Rock(1, Ore.SILVER), new Rock(1, Ore.COAL), new Rock(2, Ore.MITHRIL), new Rock(2, Ore.ADAMANTITE)), KARAMJA_VOLCANO(new WorldPoint(2856, 9579, 0), new Rock(4, Ore.GOLD)), - KEBOS_LOWLANDS(new WorldPoint(1211, 3657, 0), new Rock(9, Ore.IRON), new Rock(2, Ore.MITHRIL)), + KEBOS_LOWLANDS(new WorldPoint(1211, 3657, 0), new Rock(4, Ore.ADAMANTITE), new Rock(5, Ore.MITHRIL)), KELDAGRIM_ENTRANCE(new WorldPoint(2724, 3693, 0), new Rock(9, Ore.IRON), new Rock(2, Ore.MITHRIL)), KELDAGRIM_NORTH_EAST(new WorldPoint(2937, 10232, 0), new Rock(9, Ore.COAL)), KELDAGRIM_SOUTH_WEST_BOTTOM(new WorldPoint(2872, 10119, 0), new Rock(2, Ore.COPPER), new Rock(5, Ore.COAL)),