From 0d79490f6d4d4ba0dd7a2b67580e8e507b8e36e1 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 25 Oct 2018 11:30:01 -0700 Subject: [PATCH] inventory tags plugin: clean up plugin code This includes various code quality improvements such as stronger access control and removing redundant code. --- .../client/plugins/inventorytags/InventoryTagsPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java index 9ffe2107a9..133cbf08f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java @@ -92,7 +92,7 @@ public class InventoryTagsPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private boolean hasTaggedItems; - private boolean editorMode = false; + private boolean editorMode; @Provides InventoryTagsConfig provideConfig(ConfigManager configManager) @@ -111,12 +111,12 @@ public class InventoryTagsPlugin extends Plugin return tag; } - void setTag(int itemId, String tag) + private void setTag(int itemId, String tag) { configManager.setConfiguration(InventoryTagsConfig.GROUP, ITEM_KEY_PREFIX + itemId, tag); } - void unsetTag(int itemId) + private void unsetTag(int itemId) { configManager.unsetConfiguration(InventoryTagsConfig.GROUP, ITEM_KEY_PREFIX + itemId); } @@ -228,7 +228,7 @@ public class InventoryTagsPlugin extends Plugin final String group = getTag(itemId); final MenuEntry newMenu = new MenuEntry(); final Color color = getGroupNameColor(groupName); - newMenu.setOption(group != null && groupName.equals(group) ? MENU_REMOVE : MENU_SET); + newMenu.setOption(groupName.equals(group) ? MENU_REMOVE : MENU_SET); newMenu.setTarget(ColorUtil.prependColorTag(groupName, MoreObjects.firstNonNull(color, Color.WHITE))); newMenu.setIdentifier(itemId); newMenu.setParam1(widgetId);