From e0e07a4fb878b2bf3d05f99a0e3d15f906d54d00 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 20 Oct 2017 17:20:58 -0400 Subject: [PATCH] runelite-client: dynamically find plugins from classpath scanning --- .../client/plugins/PluginDescriptor.java | 41 ++++++ .../client/plugins/PluginManager.java | 117 ++++++++---------- .../client/plugins/account/AccountPlugin.java | 4 + .../client/plugins/boosts/Boosts.java | 4 + .../client/plugins/bosstimer/BossTimers.java | 4 + .../plugins/chatcommands/ChatCommands.java | 4 + .../client/plugins/clanchat/ClanChat.java | 4 + .../plugins/cluescrolls/ClueScrollPlugin.java | 4 + .../combatnotifier/CombatNotifier.java | 4 + .../client/plugins/config/ConfigPlugin.java | 4 + .../client/plugins/devtools/DevTools.java | 5 + .../client/plugins/examine/ExaminePlugin.java | 4 + .../client/plugins/fightcave/FightCave.java | 4 + .../client/plugins/fishing/FishingPlugin.java | 4 + .../runelite/client/plugins/fpsinfo/FPS.java | 4 + .../plugins/grounditems/GroundItems.java | 4 + .../client/plugins/hiscore/Hiscore.java | 4 + .../plugins/idlenotifier/IdleNotifier.java | 4 + .../client/plugins/implings/Implings.java | 4 + .../plugins/jewelrycount/JewelryCount.java | 4 + .../mousehighlight/MouseHighlight.java | 4 + .../plugins/opponentinfo/OpponentInfo.java | 4 + .../plugins/pestcontrol/PestControl.java | 4 + .../rememberusername/RememberUsername.java | 4 + .../client/plugins/runecraft/Runecraft.java | 4 + .../client/plugins/runepouch/Runepouch.java | 4 + .../client/plugins/timers/Timers.java | 4 + .../woodcutting/WoodcuttingPlugin.java | 4 + .../client/plugins/xpglobes/XpGlobes.java | 13 +- .../client/plugins/xptracker/XPTracker.java | 4 + .../runelite/client/plugins/xtea/Xtea.java | 4 + .../client/plugins/zulrah/Zulrah.java | 4 + 32 files changed, 220 insertions(+), 68 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/PluginDescriptor.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/PluginDescriptor.java b/runelite-client/src/main/java/net/runelite/client/plugins/PluginDescriptor.java new file mode 100644 index 00000000000..22f8e51fe98 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/PluginDescriptor.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented +public @interface PluginDescriptor +{ + String name(); + + boolean developerPlugin() default false; +} 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 a1c5c50e46a..8316102c8c8 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 @@ -24,46 +24,19 @@ */ package net.runelite.client.plugins; +import com.google.common.collect.ImmutableSet; +import com.google.common.reflect.ClassPath; +import com.google.common.reflect.ClassPath.ClassInfo; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Service; import com.google.common.util.concurrent.ServiceManager; +import java.io.IOException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; import net.runelite.client.RuneLite; -import net.runelite.client.plugins.account.AccountPlugin; -import net.runelite.client.plugins.boosts.Boosts; -import net.runelite.client.plugins.bosstimer.BossTimers; -import net.runelite.client.plugins.chatcommands.ChatCommands; -import net.runelite.client.plugins.clanchat.ClanChat; -import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; -import net.runelite.client.plugins.combatnotifier.CombatNotifier; -import net.runelite.client.plugins.config.ConfigPlugin; -import net.runelite.client.plugins.devtools.DevTools; -import net.runelite.client.plugins.examine.ExaminePlugin; -import net.runelite.client.plugins.fightcave.FightCave; -import net.runelite.client.plugins.fishing.FishingPlugin; -import net.runelite.client.plugins.fpsinfo.FPS; -import net.runelite.client.plugins.grounditems.GroundItems; -import net.runelite.client.plugins.hiscore.Hiscore; -import net.runelite.client.plugins.idlenotifier.IdleNotifier; -import net.runelite.client.plugins.implings.Implings; -import net.runelite.client.plugins.jewelrycount.JewelryCount; -import net.runelite.client.plugins.mousehighlight.MouseHighlight; -import net.runelite.client.plugins.opponentinfo.OpponentInfo; -import net.runelite.client.plugins.pestcontrol.PestControl; -import net.runelite.client.plugins.chatcommands.ChatCommands; -import net.runelite.client.plugins.rememberusername.RememberUsername; -import net.runelite.client.plugins.runecraft.Runecraft; -import net.runelite.client.plugins.runepouch.Runepouch; -import net.runelite.client.plugins.timers.Timers; -import net.runelite.client.plugins.woodcutting.WoodcuttingPlugin; -import net.runelite.client.plugins.xpglobes.XpGlobes; -import net.runelite.client.plugins.xptracker.XPTracker; -import net.runelite.client.plugins.xtea.Xtea; -import net.runelite.client.plugins.zulrah.Zulrah; import net.runelite.client.task.Schedule; import net.runelite.client.task.ScheduledMethod; import org.slf4j.Logger; @@ -73,6 +46,8 @@ public class PluginManager { private static final Logger logger = LoggerFactory.getLogger(PluginManager.class); + private static final String PLUGIN_PACKAGE = "net.runelite.client.plugins"; + private final RuneLite runelite; private ServiceManager manager; private final List plugins = new ArrayList<>(); @@ -82,42 +57,58 @@ public PluginManager(RuneLite runelite) this.runelite = runelite; } - public void loadPlugins() + public void loadPlugins() throws IOException { - plugins.add(new Boosts()); - plugins.add(new OpponentInfo()); - plugins.add(new FPS()); - plugins.add(new Hiscore()); - plugins.add(new BossTimers()); - plugins.add(new Xtea()); - plugins.add(new IdleNotifier()); - plugins.add(new Runecraft()); - plugins.add(new MouseHighlight()); - plugins.add(new PestControl()); - plugins.add(new ClanChat()); - plugins.add(new Zulrah()); - plugins.add(new AccountPlugin()); - plugins.add(new ConfigPlugin()); - plugins.add(new GroundItems()); - plugins.add(new Implings()); - plugins.add(new XpGlobes()); - plugins.add(new CombatNotifier()); - plugins.add(new JewelryCount()); - plugins.add(new XPTracker()); - plugins.add(new ExaminePlugin()); - plugins.add(new FishingPlugin()); - plugins.add(new WoodcuttingPlugin()); - plugins.add(new RememberUsername()); - plugins.add(new ChatCommands()); - plugins.add(new ClueScrollPlugin()); - plugins.add(new Timers()); - plugins.add(new Runepouch()); - plugins.add(new FightCave()); - + boolean developerPlugins = false; if (RuneLite.getOptions().has("developer-mode")) { logger.info("Loading developer plugins"); - plugins.add(new DevTools()); + developerPlugins = true; + } + + ClassPath classPath = ClassPath.from(getClass().getClassLoader()); + + ImmutableSet classes = classPath.getTopLevelClassesRecursive(PLUGIN_PACKAGE); + for (ClassInfo classInfo : classes) + { + Class clazz = classInfo.load(); + PluginDescriptor pluginDescriptor = clazz.getAnnotation(PluginDescriptor.class); + + if (pluginDescriptor == null) + { + if (clazz.getSuperclass() == Plugin.class) + { + logger.warn("Class {} is a plugin, but has no plugin descriptor", + clazz); + } + continue; + } + + if (clazz.getSuperclass() != Plugin.class) + { + logger.warn("Class {} has plugin descriptor, but is not a plugin", + clazz); + continue; + } + + if (pluginDescriptor.developerPlugin() && !developerPlugins) + { + continue; + } + + Plugin plugin; + try + { + plugin = (Plugin) clazz.newInstance(); + } + catch (InstantiationException | IllegalAccessException ex) + { + logger.warn("error initializing plugin", ex); + continue; + } + + plugins.add(plugin); + logger.debug("Loaded plugin {}", pluginDescriptor.name()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java index c0373dbcd73..35d6c5e55b8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java @@ -39,6 +39,7 @@ import net.runelite.client.events.SessionClose; import net.runelite.client.events.SessionOpen; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.ClientUI; import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.PluginToolbar; @@ -49,6 +50,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Account plugin" +) public class AccountPlugin extends Plugin { private static final Logger logger = LoggerFactory.getLogger(AccountPlugin.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/Boosts.java b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/Boosts.java index 04e1872cc5e..4a2dd45f3b1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/boosts/Boosts.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/boosts/Boosts.java @@ -27,8 +27,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Boosts plugin" +) public class Boosts extends Plugin { private final BoostsConfig config = RuneLite.getRunelite().getConfigManager().getConfig(BoostsConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/BossTimers.java b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/BossTimers.java index 5184f343938..9b8104b5426 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/BossTimers.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/BossTimers.java @@ -30,10 +30,14 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.ActorDeath; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Boss timers" +) public class BossTimers extends Plugin { private static final Logger logger = LoggerFactory.getLogger(BossTimers.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommands.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommands.java index 8ba22013410..302fbb496f0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommands.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommands.java @@ -39,6 +39,7 @@ import net.runelite.client.events.SetMessage; import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.http.api.hiscore.HiscoreClient; import net.runelite.http.api.hiscore.HiscoreSkill; import net.runelite.http.api.hiscore.SingleHiscoreSkillResult; @@ -50,6 +51,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Chat commands" +) public class ChatCommands extends Plugin { private static final Logger logger = LoggerFactory.getLogger(ChatCommands.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChat.java b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChat.java index b372428c4f5..67830943ebb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChat.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/clanchat/ClanChat.java @@ -30,8 +30,12 @@ import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; +@PluginDescriptor( + name = "Clan chat plugin" +) public class ClanChat extends Plugin { @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java index c450ef169ad..8e9f845122d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java @@ -34,8 +34,12 @@ import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; +@PluginDescriptor( + name = "Clue scroll plugin" +) public class ClueScrollPlugin extends Plugin { private final Client client = RuneLite.getClient(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/combatnotifier/CombatNotifier.java b/runelite-client/src/main/java/net/runelite/client/plugins/combatnotifier/CombatNotifier.java index 95c0115a969..f7e6bcb866d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/combatnotifier/CombatNotifier.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/combatnotifier/CombatNotifier.java @@ -35,8 +35,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.GameStateChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; +@PluginDescriptor( + name = "Combat notifier" +) public class CombatNotifier extends Plugin { private final Client client = RuneLite.getClient(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java index 6a996a16384..31137e6f306 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java @@ -28,11 +28,15 @@ import javax.swing.ImageIcon; import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.ClientUI; import net.runelite.client.ui.NavigationButton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Config plugin" +) public class ConfigPlugin extends Plugin { private static final Logger logger = LoggerFactory.getLogger(ConfigPlugin.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevTools.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevTools.java index 031e86ef1ff..1d02c3c8009 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevTools.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevTools.java @@ -31,11 +31,16 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.ClientUI; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Developer tools", + developerPlugin = true +) public class DevTools extends Plugin { private final DevToolsOverlay overlay = new DevToolsOverlay(this); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index bb7dc568315..1415c1f2ba9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -37,6 +37,7 @@ import net.runelite.client.events.GameStateChanged; import net.runelite.client.events.MenuOptionClicked; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.http.api.examine.ExamineClient; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,6 +47,9 @@ * * @author Adam */ +@PluginDescriptor( + name = "Examine plugin" +) public class ExaminePlugin extends Plugin { private static final Logger logger = LoggerFactory.getLogger(ExaminePlugin.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCave.java b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCave.java index f9ec066d75b..93a9857fd85 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCave.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/FightCave.java @@ -35,7 +35,11 @@ import net.runelite.client.ui.overlay.Overlay; import java.time.temporal.ChronoUnit; +import net.runelite.client.plugins.PluginDescriptor; +@PluginDescriptor( + name = "Fight cave plugin" +) public class FightCave extends Plugin { private final RuneLite runelite = RuneLite.getRunelite(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java index 78c3b839da8..1b69c8109c2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java @@ -35,9 +35,13 @@ import net.runelite.client.events.ChatMessage; import net.runelite.client.events.ConfigChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Fishing plugin" +) public class FishingPlugin extends Plugin { private final RuneLite runelite = RuneLite.getRunelite(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fpsinfo/FPS.java b/runelite-client/src/main/java/net/runelite/client/plugins/fpsinfo/FPS.java index 43145048115..795231f9e5b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fpsinfo/FPS.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fpsinfo/FPS.java @@ -27,9 +27,13 @@ import java.awt.Font; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Frames per second" +) public class FPS extends Plugin { private final Overlay overlay = new FPSOverlay(this); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItems.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItems.java index ca3cfac9fe8..3587953d42b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItems.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItems.java @@ -26,8 +26,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Ground items plugin" +) public class GroundItems extends Plugin { private final GroundItemsConfig config = RuneLite.getRunelite().getConfigManager() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/Hiscore.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/Hiscore.java index be9d353598a..bb8a2f9cc49 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/Hiscore.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/Hiscore.java @@ -31,11 +31,15 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.PlayerMenuOptionClicked; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.ClientUI; import net.runelite.client.ui.NavigationButton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Hiscore plugin" +) public class Hiscore extends Plugin { private static final Logger logger = LoggerFactory.getLogger(Hiscore.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifier.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifier.java index e3f2565b132..a2365dd91fb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifier.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifier.java @@ -35,8 +35,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.AnimationChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; +@PluginDescriptor( + name = "Idle notifier" +) public class IdleNotifier extends Plugin { private static final Duration WAIT_DURATION = Duration.ofMillis(2500L); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/Implings.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/Implings.java index 8d7b8b223d4..91c4d74de4c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/Implings.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/Implings.java @@ -28,12 +28,16 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.ConfigChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; /** * * @author robin */ +@PluginDescriptor( + name = "Implings plugin" +) public class Implings extends Plugin { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/jewelrycount/JewelryCount.java b/runelite-client/src/main/java/net/runelite/client/plugins/jewelrycount/JewelryCount.java index 5206ea4a8c3..682a8b1b40a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/jewelrycount/JewelryCount.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/jewelrycount/JewelryCount.java @@ -26,8 +26,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Jewelry plugin" +) public class JewelryCount extends Plugin { private final JewelryCountConfig config = RuneLite.getRunelite().getConfigManager().getConfig(JewelryCountConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlight.java b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlight.java index 6e5454dbb13..f934f87fb16 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlight.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlight.java @@ -26,8 +26,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Mouse highlight plugin" +) public class MouseHighlight extends Plugin { private final MouseHighlightConfig config = RuneLite.getRunelite().getConfigManager().getConfig(MouseHighlightConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfo.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfo.java index a70e371b936..9b5f48018b0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfo.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfo.java @@ -32,8 +32,12 @@ import java.util.Map; import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Opponent information plugin" +) public class OpponentInfo extends Plugin { private final OpponentConfig config = RuneLite.getRunelite().getConfigManager().getConfig(OpponentConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControl.java b/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControl.java index 092d8869b60..21d9c78fb35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControl.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pestcontrol/PestControl.java @@ -26,9 +26,13 @@ import java.awt.Font; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Pest control plugin" +) public class PestControl extends Plugin { private final Overlay overlay = new PestControlOverlay(this); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/rememberusername/RememberUsername.java b/runelite-client/src/main/java/net/runelite/client/plugins/rememberusername/RememberUsername.java index de092820d75..e62334c3496 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/rememberusername/RememberUsername.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/rememberusername/RememberUsername.java @@ -30,7 +30,11 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.GameStateChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +@PluginDescriptor( + name = "Remember username plugin" +) public class RememberUsername extends Plugin { private final Client client = RuneLite.getClient(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/Runecraft.java b/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/Runecraft.java index 2173aa01d94..901dc97a80b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/Runecraft.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runecraft/Runecraft.java @@ -34,8 +34,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.ChatMessage; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Runecraft plugin" +) public class Runecraft extends Plugin { private static Pattern bindNeckString = Pattern.compile("You have ([0-9]+) charges left before your Binding necklace disintegrates."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/Runepouch.java b/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/Runepouch.java index 1aff03a0ef5..13b1e0553d3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/Runepouch.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/Runepouch.java @@ -26,8 +26,12 @@ import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Runepouch plugin" +) public class Runepouch extends Plugin { private final RunepouchConfig config = RuneLite.getRunelite().getConfigManager().getConfig(RunepouchConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/Timers.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/Timers.java index e61c10fa53d..f98b8a26f27 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/Timers.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/Timers.java @@ -30,9 +30,13 @@ import net.runelite.client.events.ChatMessage; import net.runelite.client.events.ConfigChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import static net.runelite.client.plugins.timers.GameTimer.*; import net.runelite.client.ui.overlay.infobox.InfoBoxManager; +@PluginDescriptor( + name = "Timers plugin" +) public class Timers extends Plugin { private final TimersConfig config = RuneLite.getRunelite().getConfigManager().getConfig(TimersConfig.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java index 93283d1addf..0d440640a71 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java @@ -32,9 +32,13 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.ChatMessage; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; import net.runelite.client.ui.overlay.Overlay; +@PluginDescriptor( + name = "Woodcutting plugin" +) public class WoodcuttingPlugin extends Plugin { private final RuneLite runelite = RuneLite.getRunelite(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java index 0bb38484e5b..c18b186952c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpglobes/XpGlobes.java @@ -25,6 +25,10 @@ package net.runelite.client.plugins.xpglobes; import com.google.common.eventbus.Subscribe; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import net.runelite.api.Client; import net.runelite.api.Experience; import net.runelite.api.Skill; @@ -32,13 +36,12 @@ import net.runelite.client.events.ExperienceChanged; import net.runelite.client.events.GameStateChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.ui.overlay.Overlay; -import java.time.Instant; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - +@PluginDescriptor( + name = "Xp Globes plugin" +) public class XpGlobes extends Plugin { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XPTracker.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XPTracker.java index 3de7f14b894..2f6cf0e9138 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XPTracker.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XPTracker.java @@ -35,8 +35,12 @@ import net.runelite.client.ui.ClientUI; import net.runelite.client.ui.NavigationButton; import java.time.temporal.ChronoUnit; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.task.Schedule; +@PluginDescriptor( + name = "XP Tracker plugin" +) public class XPTracker extends Plugin { private static final int NUMBER_OF_SKILLS = Skill.values().length - 1; //ignore overall diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xtea/Xtea.java b/runelite-client/src/main/java/net/runelite/client/plugins/xtea/Xtea.java index a9538b9ed4e..7a3a6cd12c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xtea/Xtea.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xtea/Xtea.java @@ -33,11 +33,15 @@ import net.runelite.client.RuneLite; import net.runelite.client.events.MapRegionChanged; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.http.api.xtea.XteaClient; import okhttp3.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Xtea plugin" +) public class Xtea extends Plugin { private static final Logger logger = LoggerFactory.getLogger(Xtea.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/zulrah/Zulrah.java b/runelite-client/src/main/java/net/runelite/client/plugins/zulrah/Zulrah.java index 95189788d69..0c566f27f0a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/zulrah/Zulrah.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/zulrah/Zulrah.java @@ -37,6 +37,7 @@ import net.runelite.api.queries.NPCQuery; import net.runelite.client.RuneLite; import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.zulrah.patterns.ZulrahPattern; import net.runelite.client.plugins.zulrah.patterns.ZulrahPatternA; import net.runelite.client.plugins.zulrah.patterns.ZulrahPatternB; @@ -47,6 +48,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@PluginDescriptor( + name = "Zulrah plugin" +) public class Zulrah extends Plugin { private static final Logger logger = LoggerFactory.getLogger(Zulrah.class);