Merge pull request #2069 from Owain94/broom

project: Cleanup
This commit is contained in:
Owain van Brakel
2019-11-27 15:53:08 +01:00
committed by GitHub
555 changed files with 2627 additions and 3066 deletions

View File

@@ -316,7 +316,7 @@ public class Notifier
private static Process sendCommand(final List<String> commands) throws IOException
{
return new ProcessBuilder(commands.toArray(new String[commands.size()]))
return new ProcessBuilder(commands.toArray(new String[0]))
.redirectErrorStream(true)
.start();
}

View File

@@ -238,7 +238,7 @@ public class RuneLite
Authenticator.setDefault(new Authenticator()
{
private PasswordAuthentication auth = new PasswordAuthentication(user, pass);
private final PasswordAuthentication auth = new PasswordAuthentication(user, pass);
protected PasswordAuthentication getPasswordAuthentication()
{
@@ -308,7 +308,7 @@ public class RuneLite
log.info("Client initialization took {}ms. Uptime: {}ms", end - start, uptime);
}
public void start() throws Exception
private void start() throws Exception
{
// Load RuneLite or Vanilla client
final boolean isOutdated = client == null;

View File

@@ -41,8 +41,8 @@ import net.runelite.client.callback.Hooks;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ChatColorConfig;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.config.OpenOSRSConfig;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.game.ItemManager;
import net.runelite.client.menus.MenuManager;

View File

@@ -139,6 +139,7 @@ public class Hooks implements Callbacks
/**
* Get the Graphics2D for the MainBufferProvider image
* This caches the Graphics2D instance so it can be reused
*
* @param mainBufferProvider
* @return
*/

View File

@@ -25,8 +25,8 @@
package net.runelite.client.chat;
import java.awt.Color;
import net.runelite.client.util.ColorUtil;
import net.runelite.api.util.Text;
import net.runelite.client.util.ColorUtil;
public class ChatMessageBuilder
{

View File

@@ -46,13 +46,13 @@ import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.Varbits;
import net.runelite.api.events.ChatMessage;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.ResizeableChanged;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.events.VarbitChanged;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ChatColorConfig;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.ui.JagexColors;
import net.runelite.client.util.ColorUtil;

View File

@@ -71,6 +71,7 @@ public @interface ConfigItem
/**
* For Config items that have a value of multiple enums,
*
* @return the number of rows that are display in the item without having to scroll.
*/
int displayRows() default 2;
@@ -82,6 +83,7 @@ public @interface ConfigItem
/**
* Use this to indicate the enum class that is going to be used in the multiple select config.
* This implementation made debugging problems with multiple selects a lot easier
*
* @return The Enum that will be used for the multiple select
*/
Class<? extends Enum> enumClass() default Enum.class;

View File

@@ -59,10 +59,10 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.coords.WorldPoint;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.RuneLite;
import static net.runelite.client.RuneLite.PROFILES_DIR;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.util.ColorUtil;
import org.apache.commons.lang3.StringUtils;

View File

@@ -21,9 +21,9 @@ import net.runelite.client.config.OpenOSRSConfig;
@Singleton
public class EventBus implements EventBusInterface
{
private Map<Object, Object> subscriptionList = new HashMap<>();
private Map<Class<?>, Relay<Object>> subjectList = new HashMap<>();
private Map<Object, CompositeDisposable> subscriptionsMap = new HashMap<>();
private final Map<Object, Object> subscriptionList = new HashMap<>();
private final Map<Class<?>, Relay<Object>> subjectList = new HashMap<>();
private final Map<Object, CompositeDisposable> subscriptionsMap = new HashMap<>();
@Inject
private OpenOSRSConfig openOSRSConfig;

View File

@@ -59,7 +59,7 @@ public class Flexo extends Robot
public static final int fixedWidth = Constants.GAME_FIXED_WIDTH;
public static final int fixedHeight = Constants.GAME_FIXED_HEIGHT;
public static boolean isStretched;
public static int minDelay = 45;
public static final int minDelay = 45;
public static MouseMotionFactory currentMouseMotionFactory;
public boolean pausedIndefinitely = false;
private Robot peer;
@@ -74,7 +74,7 @@ public class Flexo extends Robot
.getDefaultScreenDevice());
}
private void init(GraphicsDevice screen) throws AWTException
private void init(GraphicsDevice screen)
{
try
{

View File

@@ -26,18 +26,7 @@
package net.runelite.client.game;
import lombok.Getter;
import static net.runelite.api.NullObjectID.NULL_25337;
import static net.runelite.api.NullObjectID.NULL_26371;
import static net.runelite.api.NullObjectID.NULL_26375;
import static net.runelite.api.NullObjectID.NULL_26884;
import static net.runelite.api.NullObjectID.NULL_26886;
import static net.runelite.api.NullObjectID.NULL_29868;
import static net.runelite.api.NullObjectID.NULL_29869;
import static net.runelite.api.NullObjectID.NULL_29870;
import static net.runelite.api.NullObjectID.NULL_31823;
import static net.runelite.api.NullObjectID.NULL_31849;
import static net.runelite.api.NullObjectID.NULL_33327;
import static net.runelite.api.NullObjectID.NULL_33328;
import static net.runelite.api.NullObjectID.*;
import static net.runelite.api.ObjectID.*;
import net.runelite.api.coords.WorldPoint;

View File

@@ -45,9 +45,9 @@ import net.runelite.api.IndexedSprite;
import net.runelite.api.SpriteID;
import net.runelite.api.events.ClanChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.util.Text;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.util.ImageUtil;
import net.runelite.api.util.Text;
@Singleton
public class ClanManager

View File

@@ -51,7 +51,7 @@ class HiscoreLoader extends CacheLoader<HiscoreManager.HiscoreKey, HiscoreResult
}
@Override
public HiscoreResult load(@NotNull HiscoreManager.HiscoreKey hiscoreKey) throws Exception
public HiscoreResult load(@NotNull HiscoreManager.HiscoreKey hiscoreKey)
{
return EMPTY;
}

View File

@@ -331,7 +331,7 @@ public class ItemManager
return getRepairValue(itemId, false);
}
public int getRepairValue(int itemId, boolean fullValue)
private int getRepairValue(int itemId, boolean fullValue)
{
final ItemReclaimCost b = ItemReclaimCost.of(itemId);

View File

@@ -38,12 +38,12 @@ import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.AnimationID;
import net.runelite.api.Client;
import net.runelite.api.TileItem;
import net.runelite.api.ItemID;
import net.runelite.api.NPC;
import net.runelite.api.NpcID;
import net.runelite.api.Player;
import net.runelite.api.Tile;
import net.runelite.api.TileItem;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.AnimationChanged;

View File

@@ -74,6 +74,7 @@ public class NPCStats
/**
* Based off the formula found here: http://services.runescape.com/m=forum/c=PLuJ4cy6gtA/forums.ws?317,318,712,65587452,209,337584542#209
*
* @return bonus XP modifier
*/
public double calculateXpModifier()

View File

@@ -57,7 +57,7 @@ public class SpriteManager
@Inject
private InfoBoxManager infoBoxManager;
public Cache<Long, BufferedImage> cache = CacheBuilder.newBuilder()
private final Cache<Long, BufferedImage> cache = CacheBuilder.newBuilder()
.maximumSize(128L)
.expireAfterAccess(1, TimeUnit.HOURS)
.build();

View File

@@ -21,9 +21,8 @@ public class XpDropManager
private int damage = 0;
@Getter(AccessLevel.PACKAGE)
private int tickShow = 0;
private int previousExpGained;
private Client client;
private EventBus eventBus;
private final Client client;
private final EventBus eventBus;
@Inject
private XpDropManager(
@@ -50,7 +49,7 @@ public class XpDropManager
Integer previous = previousSkillExpTable.put(skill, xp);
if (previous != null)
{
previousExpGained = xp - previous;
int previousExpGained = xp - previous;
XpDropEvent xpDropEvent = new XpDropEvent();
xpDropEvent.setExp(previousExpGained);
xpDropEvent.setSkill(skill);

View File

@@ -59,7 +59,7 @@ public class ChatboxItemSearch extends ChatboxTextInput
private final ItemManager itemManager;
private final Client client;
private Map<Integer, ItemDefinition> results = new LinkedHashMap<>();
private final Map<Integer, ItemDefinition> results = new LinkedHashMap<>();
private String tooltipText;
private int index = -1;
@@ -181,7 +181,7 @@ public class ChatboxItemSearch extends ChatboxTextInput
{
if (onItemSelected != null)
{
onItemSelected.accept(results.keySet().toArray(new Integer[results.size()])[index]);
onItemSelected.accept(results.keySet().toArray(new Integer[0])[index]);
}
chatboxPanelManager.close();

View File

@@ -48,6 +48,7 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.FontID;
import net.runelite.api.FontTypeFace;
import net.runelite.api.util.Text;
import net.runelite.api.widgets.JavaScriptCallback;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetPositionMode;
@@ -58,7 +59,6 @@ import net.runelite.client.callback.ClientThread;
import net.runelite.client.input.KeyListener;
import net.runelite.client.input.MouseListener;
import net.runelite.client.util.MiscUtils;
import net.runelite.api.util.Text;
@Slf4j
public class ChatboxTextInput extends ChatboxInput implements KeyListener, MouseListener
@@ -67,7 +67,7 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
private static final Pattern BREAK_MATCHER = Pattern.compile("[^a-zA-Z0-9']");
private final ChatboxPanelManager chatboxPanelManager;
protected final ClientThread clientThread;
final ClientThread clientThread;
private static IntPredicate getDefaultCharValidator()
{
@@ -135,7 +135,7 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
return this;
}
public ChatboxTextInput lines(int lines)
protected ChatboxTextInput lines(int lines)
{
this.lines = lines;
if (built)
@@ -573,7 +573,7 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
}
@Override
protected void close()
void close()
{
if (this.onClose != null)
{

View File

@@ -83,10 +83,7 @@ public class BaseComparableEntry extends AbstractComparableEntry
{
int type = entry.getOpcode();
if (this.type != type)
{
return false;
}
return this.type == type;
}
return true;

View File

@@ -11,7 +11,6 @@ public interface ComparableEntries
*
* @param option has to equal entry option
* @param target has to equal entry option
*
* @return a new BaseComparableEntry
*/
static BaseComparableEntry newBaseComparableEntry(String option, String target)
@@ -26,7 +25,6 @@ public interface ComparableEntries
* @param option has to equal option
* @param target equal or contains depending on strictTarget
* @param strictTarget read up one line
*
* @return a new BaseComparableEntry
*/
static BaseComparableEntry newBaseComparableEntry(String option, String target, boolean strictTarget)
@@ -44,7 +42,6 @@ public interface ComparableEntries
* @param type has to be the same, or -1 to skip checking
* @param strictOption strict option or nah
* @param strictTarget strict target or nah
*
* @return a new BaseComparableEntry
*/
static BaseComparableEntry newBaseComparableEntry(String option, String target, int id, int type, boolean strictOption, boolean strictTarget)
@@ -57,7 +54,7 @@ public interface ComparableEntries
* in their name. It then checks the ItemDefinition
* for each of them, to see if it's possible for
* the item to have option as one of their options.
*
* <p>
* This has to be ran on the clientthread!
*/
static ItemComparableEntry newInvItemComparableEntry(Client client, String option, String itemName)

View File

@@ -639,7 +639,7 @@ public class MenuManager
/**
* Adds to the map of swaps.
*/
public void addSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
private void addSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
{
option = option.trim().toLowerCase();
target = Text.standardize(target);
@@ -660,7 +660,7 @@ public class MenuManager
}
public void removeSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
private void removeSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
{
option = option.trim().toLowerCase();
target = Text.standardize(target);

View File

@@ -77,7 +77,9 @@ public abstract class Plugin implements Module
for (Method method : this.getClass().getDeclaredMethods())
{
if (method.getAnnotation(Subscribe.class) == null)
{
continue;
}
assert method.getParameterCount() == 1 : "Methods annotated with @Subscribe should have only one parameter";

View File

@@ -570,6 +570,7 @@ public class PluginManager
* Plugins in group 2 has dependents in group 1, etc.
* This allows for loading dependent groups serially, starting from the last group,
* while loading plugins within each group in parallel.
*
* @param graph
* @param <T>
* @return

View File

@@ -24,11 +24,12 @@
*/
package net.runelite.client.plugins.achievementdiary;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Getter
@Getter(AccessLevel.PACKAGE)
public class CombatLevelRequirement implements Requirement
{
private final int level;

View File

@@ -27,9 +27,10 @@ package net.runelite.client.plugins.achievementdiary;
import com.google.common.collect.ImmutableList;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
@Getter
@Getter(AccessLevel.PACKAGE)
class DiaryRequirement
{
private final String task;

View File

@@ -79,16 +79,6 @@ public class DiaryRequirementsPlugin extends Plugin
@Inject
private ClientThread clientThread;
@Override
protected void startUp() throws Exception
{
}
@Override
protected void shutDown() throws Exception
{
}
@Subscribe
private void onWidgetLoaded(final WidgetLoaded event)
{

View File

@@ -24,12 +24,13 @@
*/
package net.runelite.client.plugins.achievementdiary;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.Favour;
@RequiredArgsConstructor
@Getter
@Getter(AccessLevel.PACKAGE)
public class FavourRequirement implements Requirement
{
private final Favour house;

View File

@@ -27,11 +27,12 @@ package net.runelite.client.plugins.achievementdiary;
import java.util.HashSet;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
public abstract class GenericDiaryRequirement
{
@Getter
@Getter(AccessLevel.PACKAGE)
private Set<DiaryRequirement> requirements = new HashSet<>();
protected void add(String task, Requirement... requirements)

View File

@@ -27,11 +27,12 @@ package net.runelite.client.plugins.achievementdiary;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
public class OrRequirement implements Requirement
{
@Getter
@Getter(AccessLevel.PACKAGE)
private final List<Requirement> requirements;
public OrRequirement(Requirement... reqs)

View File

@@ -24,11 +24,12 @@
*/
package net.runelite.client.plugins.achievementdiary;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Getter
@Getter(AccessLevel.PACKAGE)
public class QuestPointRequirement implements Requirement
{
private final int qp;

View File

@@ -24,11 +24,12 @@
*/
package net.runelite.client.plugins.achievementdiary;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.Quest;
@Getter
@Getter(AccessLevel.PACKAGE)
@RequiredArgsConstructor
public class QuestRequirement implements Requirement
{

View File

@@ -24,12 +24,13 @@
*/
package net.runelite.client.plugins.achievementdiary;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.Skill;
@RequiredArgsConstructor
@Getter
@Getter(AccessLevel.PACKAGE)
public class SkillRequirement implements Requirement
{
private final Skill skill;

View File

@@ -135,12 +135,6 @@ public class AgilityPlugin extends Plugin
@Getter(AccessLevel.PACKAGE)
private int agilityLevel;
@Provides
AgilityConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(AgilityConfig.class);
}
// Config values
@Getter(AccessLevel.PACKAGE)
private boolean removeDistanceCap;
@@ -167,8 +161,14 @@ public class AgilityPlugin extends Plugin
private boolean notifyAgilityArena;
private boolean showAgilityArenaTimer;
@Provides
AgilityConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(AgilityConfig.class);
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -183,7 +183,7 @@ public class AgilityPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
eventBus.unregister(MENU_SUBS);
@@ -255,7 +255,7 @@ public class AgilityPlugin extends Plugin
}
}
public void updateConfig()
private void updateConfig()
{
this.removeDistanceCap = config.removeDistanceCap();
this.showLapCount = config.showLapCount();

View File

@@ -25,6 +25,7 @@
package net.runelite.client.plugins.agility;
import java.time.Instant;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import net.runelite.api.Client;
@@ -32,8 +33,8 @@ import net.runelite.api.Experience;
import net.runelite.api.Skill;
import net.runelite.api.VarPlayer;
@Getter
@Setter
@Getter(AccessLevel.PACKAGE)
@Setter(AccessLevel.PACKAGE)
class AgilitySession
{
private final Courses course;

View File

@@ -70,6 +70,12 @@ import net.runelite.client.ui.overlay.OverlayManager;
@Singleton
public class HydraPlugin extends Plugin
{
private static final int[] HYDRA_REGIONS = {
5279, 5280,
5535, 5536
};
private static final int STUN_LENGTH = 7;
@Getter(AccessLevel.PACKAGE)
private Map<LocalPoint, Projectile> poisonProjectiles = new HashMap<>();
@@ -88,12 +94,6 @@ public class HydraPlugin extends Plugin
private boolean inHydraInstance;
private int lastAttackTick;
private static final int[] HYDRA_REGIONS = {
5279, 5280,
5535, 5536
};
private static final int STUN_LENGTH = 7;
@Inject
private Client client;

View File

@@ -64,7 +64,7 @@ public class AmmoPlugin extends Plugin
private AmmoCounter counterBox;
@Override
protected void startUp() throws Exception
protected void startUp()
{
clientThread.invokeLater(() ->
@@ -79,7 +79,7 @@ public class AmmoPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
infoBoxManager.removeInfoBox(counterBox);
counterBox = null;

View File

@@ -58,13 +58,13 @@ public class AnimationSmoothingPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
update();
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
client.setInterpolatePlayerAnimations(false);
client.setInterpolateNpcAnimations(false);

View File

@@ -74,20 +74,74 @@ public class AntiDragPlugin extends Plugin
@Inject
private KeyManager keyManager;
@Provides
AntiDragConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(AntiDragConfig.class);
}
private boolean toggleDrag;
private boolean configOverlay;
private boolean changeCursor;
private CustomCursor selectedCursor;
private Keybind key;
private final HotkeyListener toggleListener = new HotkeyListener(() -> this.key)
{
@Override
protected void startUp() throws Exception
public void hotkeyPressed()
{
toggleDrag = !toggleDrag;
if (toggleDrag)
{
if (configOverlay)
{
overlayManager.add(overlay);
}
if (changeCursor)
{
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}
client.setInventoryDragDelay(config.dragDelay());
}
else
{
overlayManager.remove(overlay);
client.setInventoryDragDelay(DEFAULT_DELAY);
clientUI.resetCursor();
}
}
};
private final HotkeyListener holdListener = new HotkeyListener(() -> this.key)
{
@Override
public void hotkeyPressed()
{
if (configOverlay)
{
overlayManager.add(overlay);
}
if (changeCursor)
{
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}
client.setInventoryDragDelay(config.dragDelay());
}
@Override
public void hotkeyReleased()
{
overlayManager.remove(overlay);
client.setInventoryDragDelay(DEFAULT_DELAY);
clientUI.resetCursor();
}
};
@Provides
AntiDragConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(AntiDragConfig.class);
}
@Override
protected void startUp()
{
overlay.setColor(config.color());
updateConfig();
@@ -100,7 +154,7 @@ public class AntiDragPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
client.setInventoryDragDelay(DEFAULT_DELAY);
keyManager.unregisterKeyListener(holdListener);
@@ -194,58 +248,4 @@ public class AntiDragPlugin extends Plugin
keyManager.unregisterKeyListener(toggleListener);
}
}
private final HotkeyListener toggleListener = new HotkeyListener(() -> this.key)
{
@Override
public void hotkeyPressed()
{
toggleDrag = !toggleDrag;
if (toggleDrag)
{
if (configOverlay)
{
overlayManager.add(overlay);
}
if (changeCursor)
{
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}
client.setInventoryDragDelay(config.dragDelay());
}
else
{
overlayManager.remove(overlay);
client.setInventoryDragDelay(DEFAULT_DELAY);
clientUI.resetCursor();
}
}
};
private final HotkeyListener holdListener = new HotkeyListener(() -> this.key)
{
@Override
public void hotkeyPressed()
{
if (configOverlay)
{
overlayManager.add(overlay);
}
if (changeCursor)
{
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}
client.setInventoryDragDelay(config.dragDelay());
}
@Override
public void hotkeyReleased()
{
overlayManager.remove(overlay);
client.setInventoryDragDelay(DEFAULT_DELAY);
clientUI.resetCursor();
}
};
}

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.aoewarnings;
import java.awt.Color;
import java.awt.Font;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.client.config.Config;
@@ -40,7 +41,7 @@ import net.runelite.client.config.Title;
@ConfigGroup("aoe")
public interface AoeWarningConfig extends Config
{
@Getter
@Getter(AccessLevel.PACKAGE)
@AllArgsConstructor
enum FontStyle
{

View File

@@ -72,30 +72,42 @@ import net.runelite.client.ui.overlay.OverlayManager;
@Slf4j
public class AoeWarningPlugin extends Plugin
{
@Inject
public AoeWarningConfig config;
@Inject
private Notifier notifier;
@Inject
private OverlayManager overlayManager;
@Inject
private AoeWarningOverlay coreOverlay;
@Inject
private BombOverlay bombOverlay;
@Inject
private Client client;
@Getter(AccessLevel.PACKAGE)
private List<WorldPoint> lightningTrail = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> acidTrail = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> crystalSpike = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> wintertodtSnowFall = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private final Set<CrystalBomb> bombs = new HashSet<>();
@Getter(AccessLevel.PACKAGE)
private final Set<ProjectileContainer> projectiles = new HashSet<>();
@Inject
public AoeWarningConfig config;
@Inject
private Notifier notifier;
@Inject
private OverlayManager overlayManager;
@Inject
private AoeWarningOverlay coreOverlay;
@Inject
private BombOverlay bombOverlay;
@Inject
private Client client;
@Getter(AccessLevel.PACKAGE)
private List<WorldPoint> lightningTrail = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> acidTrail = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> crystalSpike = new ArrayList<>();
@Getter(AccessLevel.PACKAGE)
private List<GameObject> wintertodtSnowFall = new ArrayList<>();
// Config values
private boolean aoeNotifyAll;
@Getter(AccessLevel.PACKAGE)

View File

@@ -70,7 +70,7 @@ public class AttackStylesPlugin extends Plugin
private int attackStyleVarbit = -1;
private int equippedWeaponTypeVarbit = -1;
private int castingModeVarbit = -1;
@Getter
@Getter(AccessLevel.PACKAGE)
@Nullable
private AttackStyle attackStyle;
private final Set<Skill> warnedSkills = new HashSet<>();
@@ -112,7 +112,7 @@ public class AttackStylesPlugin extends Plugin
boolean removeWarnedStyles;
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();

View File

@@ -160,7 +160,7 @@ public class BankPlugin extends Plugin
private boolean rightClickBankLoot;
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
searchString = "";

View File

@@ -97,9 +97,9 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
{
public static final String CONFIG_GROUP = "banktags";
public static final String TAG_SEARCH = "tag:";
private static final String EDIT_TAGS_MENU_OPTION = "Edit-tags";
public static final String ICON_SEARCH = "icon_";
public static final String VAR_TAG_SUFFIX = "*";
private static final String EDIT_TAGS_MENU_OPTION = "Edit-tags";
private static final String NUMBER_REGEX = "[0-9]+(\\.[0-9]+)?[kmb]?";
private static final String SEARCH_BANK_INPUT_TEXT =
@@ -112,6 +112,8 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
" *(((?<op>[<>=]|>=|<=) *(?<num>" + NUMBER_REGEX + "))|" +
"((?<num1>" + NUMBER_REGEX + ") *- *(?<num2>" + NUMBER_REGEX + ")))$", Pattern.CASE_INSENSITIVE);
@VisibleForTesting
final Multiset<Integer> itemQuantities = HashMultiset.create();
@Inject
private ItemManager itemManager;
@@ -151,8 +153,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
private boolean shiftPressed = false;
private int nextRowIndex = 0;
@VisibleForTesting
Multiset<Integer> itemQuantities = HashMultiset.create();
@Provides
BankTagsConfig getConfig(ConfigManager configManager)
@@ -171,6 +171,18 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
spriteManager.addSpriteOverrides(TabSprites.values());
}
@Override
public void shutDown()
{
keyManager.unregisterKeyListener(this);
mouseManager.unregisterMouseWheelListener(this);
clientThread.invokeLater(tabInterface::destroy);
spriteManager.removeSpriteOverrides(TabSprites.values());
shiftPressed = false;
itemQuantities.clear();
}
@Deprecated
private void cleanConfig()
{
@@ -224,18 +236,6 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
}
}
@Override
public void shutDown()
{
keyManager.unregisterKeyListener(this);
mouseManager.unregisterMouseWheelListener(this);
clientThread.invokeLater(tabInterface::destroy);
spriteManager.removeSpriteOverrides(TabSprites.values());
shiftPressed = false;
itemQuantities.clear();
}
private boolean isSearching()
{
return client.getVar(VarClientInt.INPUT_TYPE) == InputType.SEARCH.getType()

View File

@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.ItemID;
import net.runelite.api.util.Text;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.game.ItemManager;
import net.runelite.client.game.ItemVariationMapping;
@@ -45,7 +46,6 @@ import net.runelite.client.plugins.cluescrolls.clues.FairyRingClue;
import net.runelite.client.plugins.cluescrolls.clues.HotColdClue;
import net.runelite.client.plugins.cluescrolls.clues.MapClue;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import net.runelite.api.util.Text;
@Singleton
public class TagManager

View File

@@ -131,7 +131,7 @@ public class TabInterface
private final Rectangle bounds = new Rectangle();
private final Rectangle canvasBounds = new Rectangle();
private ChatboxItemSearch searchProvider;
private final ChatboxItemSearch searchProvider;
private TagTab activeTab;
private int maxTabs;
private int currentTabIndex;
@@ -302,7 +302,7 @@ public class TabInterface
final Iterator<String> dataIter = Text.fromCSV(dataString).iterator();
String name = dataIter.next();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (char c : name.toCharArray())
{
if (FILTERED_CHARS.test(c))
@@ -324,7 +324,7 @@ public class TabInterface
while (dataIter.hasNext())
{
final int itemId = Integer.valueOf(dataIter.next());
final int itemId = Integer.parseInt(dataIter.next());
tagManager.addTag(itemId, name, itemId < 0);
}

View File

@@ -33,12 +33,13 @@ import java.util.Optional;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.ItemID;
import net.runelite.api.util.Text;
import net.runelite.client.config.ConfigManager;
import static net.runelite.client.plugins.banktags.BankTagsPlugin.CONFIG_GROUP;
import static net.runelite.client.plugins.banktags.BankTagsPlugin.ICON_SEARCH;
import net.runelite.api.util.Text;
import org.apache.commons.lang3.math.NumberUtils;
@Singleton
@@ -46,7 +47,7 @@ class TabManager
{
private static final String TAG_TABS_CONFIG = "tagtabs";
@Getter
@Getter(AccessLevel.PACKAGE)
private final List<TagTab> tabs = new ArrayList<>();
private final ConfigManager configManager;

View File

@@ -25,6 +25,7 @@
*/
package net.runelite.client.plugins.banktags.tabs;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.client.game.SpriteOverride;
@@ -39,9 +40,9 @@ public enum TabSprites implements SpriteOverride
DOWN_ARROW(-204, "down-arrow.png"),
NEW_TAB(-205, "new-tab.png");
@Getter
@Getter(AccessLevel.PUBLIC)
private final int spriteId;
@Getter
@Getter(AccessLevel.PUBLIC)
private final String fileName;
}

View File

@@ -106,7 +106,7 @@ public class BanListPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -116,7 +116,7 @@ public class BanListPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
wdrScamSet.clear();

View File

@@ -45,6 +45,7 @@ public interface BarbarianAssaultConfig extends Config
{
return true;
}
@ConfigItem(
keyName = "showTimer",
name = "Show call change timer",

View File

@@ -122,6 +122,24 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
private static final ImmutableList<WidgetInfo> attackStyles = ImmutableList.of(WidgetInfo.COMBAT_STYLE_ONE,
WidgetInfo.COMBAT_STYLE_TWO, WidgetInfo.COMBAT_STYLE_THREE, WidgetInfo.COMBAT_STYLE_FOUR);
@Getter(AccessLevel.PACKAGE)
private final Map<WorldPoint, Integer> redEggs = new HashMap<>();
@Getter(AccessLevel.PACKAGE)
private final Map<WorldPoint, Integer> greenEggs = new HashMap<>();
@Getter(AccessLevel.PACKAGE)
private final Map<WorldPoint, Integer> blueEggs = new HashMap<>();
@Getter(AccessLevel.PACKAGE)
private final Map<WorldPoint, Integer> yellowEggs = new HashMap<>();
@Getter(AccessLevel.PACKAGE)
private final Map<Integer, Healer> healers = new HashMap<>();
private final List<TimerBox> deathTimes = new ArrayList<>();
private final Map<Integer, Projectile> projectiles = new HashMap<>();
@Inject
private Client client;
@@ -155,99 +173,50 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
@Inject
private KeyManager keyManager;
@Getter
@Getter(AccessLevel.PACKAGE)
private boolean inGame = false;
@Getter
@Getter(AccessLevel.PACKAGE)
private Wave wave = null;
@Getter
@Getter(AccessLevel.PACKAGE)
private Role role = null;
@Getter
@Getter(AccessLevel.PACKAGE)
private Scorecard scorecard = null;
@Getter
@Getter(AccessLevel.PACKAGE)
private Timer gameTimer = null;
@Getter
@Getter(AccessLevel.PACKAGE)
private Timer callTimer = null;
@Getter
@Getter(AccessLevel.PACKAGE)
private int stage = -1;
@Getter
@Getter(AccessLevel.PACKAGE)
private BufferedImage clockImage;
@Getter
@Getter(AccessLevel.PACKAGE)
private Font font = null;
@Getter
private final Map<WorldPoint, Integer> redEggs = new HashMap<>();
@Getter
private final Map<WorldPoint, Integer> greenEggs = new HashMap<>();
@Getter
private final Map<WorldPoint, Integer> blueEggs = new HashMap<>();
@Getter
private final Map<WorldPoint, Integer> yellowEggs = new HashMap<>();
@Getter
private final Map<Integer, Healer> healers = new HashMap<>();
@Getter
private String lastCallText = null;
@Getter
private String lastListenText = null;
// private String lastClickedTell = null;
@Getter(AccessLevel.PACKAGE)
private String lastCallText = null;
@Getter(AccessLevel.PACKAGE)
private String lastListenText = null;
private int lastCallColor = -1;
private int lastInteracted = -1;
private int lastHealerPoisoned = -1;
private int tickNum = 0;
// private int gameTick = -1;
private int lastHealerPoisoned = -1;
private int tickNum = 0;
private int inGameBit = 0;
private boolean syncd = true;
private boolean tickReset = false;
private boolean hornCalled = false;
private boolean hornListened = false;
@Getter
@Getter(AccessLevel.PACKAGE)
private boolean usingGloryHorn = false;
private boolean shiftDown = false;
private boolean controlDown = false;
private BufferedImage torsoImage, fighterImage, healerImage, rangerImage, runnerImage;
private final List<TimerBox> deathTimes = new ArrayList<>();
private final Map<Integer, Projectile> projectiles = new HashMap<>();
private TimerBox tickCounter;
private String poisonUsed = null;
@Provides
BarbarianAssaultConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(BarbarianAssaultConfig.class);
}
// save config values
@Getter(AccessLevel.PACKAGE)
private boolean swapLadder;
@@ -302,8 +271,14 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
@Getter(AccessLevel.PACKAGE)
private boolean showEggCountOverlay;
@Provides
BarbarianAssaultConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(BarbarianAssaultConfig.class);
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -321,7 +296,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(widgetsOverlay);
overlayManager.remove(sceneOverlay);
@@ -399,7 +374,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
case "swapLadder":
case "swapCollectorBag":
case "swapDestroyEggs":
if (Boolean.valueOf(configChanged.getNewValue()))
if (Boolean.parseBoolean(configChanged.getNewValue()))
{
menu.enableSwaps();
}

View File

@@ -26,6 +26,7 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.ImmutableSet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.api.MenuOpcode;
@@ -86,10 +87,10 @@ public enum Menus
MEDIC_HORN(null, newBaseComparableEntry("medic", "r horn", -1, -1, true, false)),
USE_HORN(null, newBaseComparableEntry("use", "r horn", -1, -1, true, false));
@Getter
@Getter(AccessLevel.PACKAGE)
private final Role role;
@Getter
@Getter(AccessLevel.PACKAGE)
private final BaseComparableEntry entry;
private static final ImmutableSet<Menus> ALL = ImmutableSet.copyOf(Menus.values());

View File

@@ -27,6 +27,7 @@
package net.runelite.client.plugins.barbarianassault;
import com.google.common.collect.ImmutableMap;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.api.Client;
@@ -51,19 +52,19 @@ enum Role
WidgetInfo.BA_HEAL_CALL_TEXT, WidgetInfo.BA_DEF_HORN_LISTEN_TEXT, WidgetInfo.BA_HEAL_ROLE_TEXT,
WidgetInfo.BA_HEAL_ROLE_SPRITE);
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo wave;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo listen;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo gloryListen;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo call;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo gloryCall;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo roleText;
@Getter
@Getter(AccessLevel.PACKAGE)
private final WidgetInfo roleSprite;
// Duplicate* entries are to catch instances where the horn of glory has

View File

@@ -101,7 +101,7 @@ public class BarrowsPlugin extends Plugin
private LoopTimer barrowsPrayerDrainTimer;
private boolean wasInCrypt = false;
@Getter
@Getter(AccessLevel.PACKAGE)
private Widget puzzleAnswer;
@Inject
@@ -125,12 +125,6 @@ public class BarrowsPlugin extends Plugin
@Inject
private BarrowsConfig config;
@Provides
BarrowsConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(BarrowsConfig.class);
}
@Getter(AccessLevel.PACKAGE)
private boolean showMinimap;
@Getter(AccessLevel.PACKAGE)
@@ -143,8 +137,14 @@ public class BarrowsPlugin extends Plugin
private boolean showPuzzleAnswer;
private boolean showPrayerDrainTimer;
@Provides
BarrowsConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(BarrowsConfig.class);
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();

View File

@@ -81,12 +81,16 @@ public class BlackjackPlugin extends Plugin
@Inject
private Client client;
@Inject
private BlackjackConfig config;
@Inject
private EventBus eventBus;
@Inject
private MenuManager menuManager;
private boolean pickpocketOnAggro;
private boolean random;
private long nextKnockOutTick = 0;
@@ -98,7 +102,7 @@ public class BlackjackPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
menuManager.addPriorityEntry(KNOCKOUT_BANDIT);
menuManager.addPriorityEntry(KNOCKOUT_MENAPHITE);
@@ -106,7 +110,7 @@ public class BlackjackPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
menuManager.removePriorityEntry(PICKPOCKET_BANDIT);
menuManager.removePriorityEntry(PICKPOCKET_MENAPHITE);

View File

@@ -26,6 +26,7 @@ package net.runelite.client.plugins.blastfurnace;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.ItemID;
import net.runelite.api.Varbits;
@@ -64,9 +65,9 @@ public enum BarsOres
VARBIT = builder.build();
}
@Getter
@Getter(AccessLevel.PACKAGE)
private final Varbits varbit;
@Getter
@Getter(AccessLevel.PACKAGE)
private final int itemID;
BarsOres(Varbits varbit, int itemID)

View File

@@ -38,8 +38,8 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.table.TableComponent;
import net.runelite.client.ui.overlay.components.table.TableAlignment;
import net.runelite.client.ui.overlay.components.table.TableComponent;
import net.runelite.client.util.QuantityFormatter;
@Singleton

View File

@@ -103,7 +103,7 @@ public class BlastFurnacePlugin extends Plugin
private boolean showBarDispenser;
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();

View File

@@ -73,12 +73,6 @@ public class BlastMinePlugin extends Plugin
@Inject
private BlastMinePluginConfig config;
@Provides
BlastMinePluginConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(BlastMinePluginConfig.class);
}
@Getter(AccessLevel.PACKAGE)
private boolean showOreOverlay;
@Getter(AccessLevel.PACKAGE)
@@ -92,8 +86,14 @@ public class BlastMinePlugin extends Plugin
@Getter(AccessLevel.PACKAGE)
private Color warningColor;
@Provides
BlastMinePluginConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(BlastMinePluginConfig.class);
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -102,7 +102,7 @@ public class BlastMinePlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(blastMineRockOverlay);
overlayManager.remove(blastMineOreCountOverlay);

View File

@@ -73,6 +73,11 @@ public class BoostsPlugin extends Plugin
Skill.COOKING, Skill.CRAFTING, Skill.FIREMAKING, Skill.FLETCHING, Skill.WOODCUTTING, Skill.RUNECRAFT,
Skill.SLAYER, Skill.FARMING, Skill.CONSTRUCTION, Skill.HUNTER);
@Getter
private final Set<Skill> shownSkills = new LinkedHashSet<>();
private final int[] lastSkillLevels = new int[Skill.values().length - 1];
private final List<String> boostedSkillsChanged = new ArrayList<>();
@Inject
private Notifier notifier;
@@ -88,26 +93,21 @@ public class BoostsPlugin extends Plugin
@Inject
private BoostsOverlay boostsOverlay;
//made this a LinkedHashSet so the order stays consistent for my OCD
@Getter
private final Set<Skill> shownSkills = new LinkedHashSet<>();
@Inject
private BoostsConfig config;
@Inject
private SkillIconManager skillIconManager;
@Inject
private CombatIconsOverlay combatIconsOverlay;
private boolean isChangedDown = false;
private boolean isChangedUp = false;
private final int[] lastSkillLevels = new int[Skill.values().length - 1];
private int lastChangeDown = -1;
private int lastChangeUp = -1;
private boolean preserveBeenActive = false;
private long lastTickMillis;
private final List<String> boostedSkillsChanged = new ArrayList<>();
private BoostsConfig.DisplayBoosts displayBoosts;
@Getter(AccessLevel.PACKAGE)
private boolean useRelativeBoost;
@@ -130,7 +130,7 @@ public class BoostsPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -154,7 +154,7 @@ public class BoostsPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(boostsOverlay);
overlayManager.remove(combatIconsOverlay);

View File

@@ -11,6 +11,7 @@ import net.runelite.api.Client;
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG;
import net.runelite.api.Skill;
import net.runelite.client.game.SkillIconManager;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.Overlay;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
@@ -20,7 +21,6 @@ import net.runelite.client.ui.overlay.components.ComponentOrientation;
import net.runelite.client.ui.overlay.components.ImageComponent;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.FontManager;
import net.runelite.client.util.ColorUtil;
import net.runelite.client.util.ImageUtil;

View File

@@ -52,12 +52,7 @@ public class BossTimersPlugin extends Plugin
private ItemManager itemManager;
@Override
protected void startUp() throws Exception
{
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
infoBoxManager.removeIf(t -> t instanceof RespawnTimer);
}

View File

@@ -36,7 +36,7 @@ public class BossTimeTracker extends InfoBox
{
private final Instant startTime;
private LocalTime time;
private Instant lastTime;
private final Instant lastTime;
public BossTimeTracker(BufferedImage image, BossTimeTrackerPlugin plugin, Instant startTime, Instant lastTime)
{
@@ -80,10 +80,7 @@ public class BossTimeTracker extends InfoBox
@Override
public String getTooltip()
{
StringBuilder builder = new StringBuilder();
builder.append("Elapsed time: ");
builder.append(time.format(DateTimeFormatter.ofPattern("HH:mm:ss")));
return builder.toString();
return "Elapsed time: " +
time.format(DateTimeFormatter.ofPattern("HH:mm:ss"));
}
}

View File

@@ -30,6 +30,7 @@ import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
@@ -76,7 +77,7 @@ public class BossTimeTrackerPlugin extends Plugin
@Inject
private ConfigManager configManager;
@Getter
@Getter(AccessLevel.PACKAGE)
private BossTimeTracker timer;
private Instant startTime;
@@ -84,11 +85,6 @@ public class BossTimeTrackerPlugin extends Plugin
private Boolean started = false;
private boolean loggingIn;
@Override
public void startUp()
{
}
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
@@ -238,7 +234,7 @@ public class BossTimeTrackerPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
removeTimer();
resetConfig();

View File

@@ -2,15 +2,15 @@ package net.runelite.client.plugins.bronzeman;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.client.game.ItemManager;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
import javax.inject.Inject;
import java.awt.image.BufferedImage;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**

View File

@@ -13,6 +13,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
@@ -60,7 +61,7 @@ public class BronzemanPlugin extends Plugin
private List<Integer> unlockedItems;
@Getter
@Getter(AccessLevel.PACKAGE)
private BufferedImage unlockImage = null;
/**
* Loads GrandExchange widgets for further manipulation of the interface
@@ -69,7 +70,7 @@ public class BronzemanPlugin extends Plugin
private Widget grandExchangeChatBox;
@Override
protected void startUp() throws Exception
protected void startUp()
{
loadUnlockImage();
unlockedItems = new ArrayList<>();
@@ -77,7 +78,7 @@ public class BronzemanPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
unlockedItems = null;
overlayManager.remove(bronzemanOverlay);
@@ -178,7 +179,7 @@ public class BronzemanPlugin extends Plugin
/**
* Queues a new unlock to be properly displayed
**/
public void queueItemUnlock(int itemId)
private void queueItemUnlock(int itemId)
{
unlockedItems.add(itemId);
bronzemanOverlay.addItemUnlock(itemId);

View File

@@ -1,5 +1,6 @@
package net.runelite.client.plugins.bronzeman;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
@@ -11,14 +12,14 @@ import lombok.Setter;
public class ItemUnlock
{
@Getter
@Getter(AccessLevel.PACKAGE)
private final int itemId;
@Getter
@Getter(AccessLevel.PACKAGE)
private long initTime;
@Getter
@Setter
@Getter(AccessLevel.PACKAGE)
@Setter(AccessLevel.PACKAGE)
private int locationY;
ItemUnlock(int itemId)

View File

@@ -79,34 +79,49 @@ public class CannonPlugin extends Plugin
);
private CannonCounter counter;
private boolean skipProjectileCheckThisTick;
@Getter(AccessLevel.PACKAGE)
private int cballsLeft;
@Getter(AccessLevel.PACKAGE)
private boolean cannonPlaced;
@Getter(AccessLevel.PACKAGE)
private WorldPoint cannonPosition;
@Getter(AccessLevel.PACKAGE)
private GameObject cannon;
@Getter(AccessLevel.PACKAGE)
private List<WorldPoint> spotPoints = new ArrayList<>();
@Inject
private ItemManager itemManager;
@Inject
private InfoBoxManager infoBoxManager;
@Inject
private Notifier notifier;
@Inject
private OverlayManager overlayManager;
@Inject
private CannonOverlay cannonOverlay;
@Inject
private CannonSpotOverlay cannonSpotOverlay;
@Inject
private CannonConfig config;
@Inject
private Client client;
@Inject
private ClientThread clientThread;
private boolean lock;
private boolean showEmptyCannonNotification;
private boolean showInfobox;
@@ -126,7 +141,7 @@ public class CannonPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -136,7 +151,7 @@ public class CannonPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
cannonSpotOverlay.setHidden(true);
overlayManager.remove(cannonOverlay);
@@ -271,7 +286,7 @@ public class CannonPlugin extends Plugin
// counter doesn't decrease if the player has been too far away
// from the cannon due to the projectiels not being in memory,
// so our counter can be higher than it is supposed to be.
int amt = Integer.valueOf(m.group());
int amt = Integer.parseInt(m.group());
if (cballsLeft + amt >= MAX_CBALLS)
{
skipProjectileCheckThisTick = true;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.cannon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.coords.WorldPoint;
@@ -67,7 +68,7 @@ public enum CannonSpots
ICE_WARRIOR(new WorldPoint(2955, 3876, 0)),
BANDIT(new WorldPoint(3037, 3700, 0));
@Getter
@Getter(AccessLevel.PACKAGE)
private static final List<WorldPoint> cannonSpots = new ArrayList<>();
static

View File

@@ -30,6 +30,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.GameState;
import net.runelite.api.NPC;
@@ -50,7 +51,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
@Singleton
public class CerberusPlugin extends Plugin
{
@Getter
@Getter(AccessLevel.PACKAGE)
private final List<NPC> ghosts = new ArrayList<>();
@Inject
@@ -60,13 +61,13 @@ public class CerberusPlugin extends Plugin
private CerberusOverlay overlay;
@Override
protected void startUp() throws Exception
protected void startUp()
{
overlayManager.add(overlay);
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(overlay);
ghosts.clear();

View File

@@ -148,6 +148,192 @@ public class ChatCommandsPlugin extends Plugin
@Inject
private ChatKeyboardListener chatKeyboardListener;
/**
* Returns the ironman status based on the symbol in the name of the player.
*
* @param name player name
* @return hiscore endpoint
*/
private static HiscoreEndpoint getHiscoreEndpointByName(final String name)
{
if (name.contains(IconID.IRONMAN.toString()))
{
return toEndPoint(AccountType.IRONMAN);
}
else if (name.contains(IconID.ULTIMATE_IRONMAN.toString()))
{
return toEndPoint(AccountType.ULTIMATE_IRONMAN);
}
else if (name.contains(IconID.HARDCORE_IRONMAN.toString()))
{
return toEndPoint(AccountType.HARDCORE_IRONMAN);
}
else
{
return toEndPoint(AccountType.NORMAL);
}
}
/**
* Converts account type to hiscore endpoint
*
* @param accountType account type
* @return hiscore endpoint
*/
private static HiscoreEndpoint toEndPoint(final AccountType accountType)
{
switch (accountType)
{
case IRONMAN:
return HiscoreEndpoint.IRONMAN;
case ULTIMATE_IRONMAN:
return HiscoreEndpoint.ULTIMATE_IRONMAN;
case HARDCORE_IRONMAN:
return HiscoreEndpoint.HARDCORE_IRONMAN;
default:
return HiscoreEndpoint.NORMAL;
}
}
private static String longBossName(String boss)
{
switch (boss.toLowerCase())
{
case "corp":
return "Corporeal Beast";
case "jad":
return "TzTok-Jad";
case "kq":
return "Kalphite Queen";
case "chaos ele":
return "Chaos Elemental";
case "dusk":
case "dawn":
case "gargs":
return "Grotesque Guardians";
case "crazy arch":
return "Crazy Archaeologist";
case "deranged arch":
return "Deranged Archaeologist";
case "mole":
return "Giant Mole";
case "vetion":
return "Vet'ion";
case "vene":
return "Venenatis";
case "kbd":
return "King Black Dragon";
case "vork":
return "Vorkath";
case "sire":
return "Abyssal Sire";
case "smoke devil":
case "thermy":
return "Thermonuclear Smoke Devil";
case "cerb":
return "Cerberus";
case "zuk":
case "inferno":
return "TzKal-Zuk";
case "hydra":
return "Alchemical Hydra";
// gwd
case "sara":
case "saradomin":
case "zilyana":
case "zily":
return "Commander Zilyana";
case "zammy":
case "zamorak":
case "kril":
case "kril trutsaroth":
return "K'ril Tsutsaroth";
case "arma":
case "kree":
case "kreearra":
case "armadyl":
return "Kree'arra";
case "bando":
case "bandos":
case "graardor":
return "General Graardor";
// dks
case "supreme":
return "Dagannoth Supreme";
case "rex":
return "Dagannoth Rex";
case "prime":
return "Dagannoth Prime";
case "wt":
return "Wintertodt";
case "barrows":
return "Barrows Chests";
case "herbi":
return "Herbiboar";
// cox
case "cox":
case "xeric":
case "chambers":
case "olm":
case "raids":
return "Chambers of Xeric";
// cox cm
case "cox cm":
case "xeric cm":
case "chambers cm":
case "olm cm":
case "raids cm":
return "Chambers of Xeric Challenge Mode";
// tob
case "tob":
case "theatre":
case "verzik":
case "verzik vitur":
case "raids 2":
return "Theatre of Blood";
// agility course
case "prif":
case "prifddinas":
return "Prifddinas Agility Course";
// The Gauntlet
case "gaunt":
case "gauntlet":
return "Gauntlet";
// Corrupted Gauntlet
case "cgaunt":
case "cgauntlet":
return "Corrupted Gauntlet";
default:
return WordUtils.capitalize(boss);
}
}
@Override
public void startUp()
{
@@ -721,7 +907,6 @@ public class ChatCommandsPlugin extends Plugin
return true;
}
private void personalBestLookup(ChatMessage chatMessage, String message)
{
if (!config.pb())
@@ -1219,196 +1404,10 @@ public class ChatCommandsPlugin extends Plugin
return toEndPoint(client.getAccountType());
}
/**
* Returns the ironman status based on the symbol in the name of the player.
*
* @param name player name
* @return hiscore endpoint
*/
private static HiscoreEndpoint getHiscoreEndpointByName(final String name)
{
if (name.contains(IconID.IRONMAN.toString()))
{
return toEndPoint(AccountType.IRONMAN);
}
else if (name.contains(IconID.ULTIMATE_IRONMAN.toString()))
{
return toEndPoint(AccountType.ULTIMATE_IRONMAN);
}
else if (name.contains(IconID.HARDCORE_IRONMAN.toString()))
{
return toEndPoint(AccountType.HARDCORE_IRONMAN);
}
else
{
return toEndPoint(AccountType.NORMAL);
}
}
/**
* Converts account type to hiscore endpoint
*
* @param accountType account type
* @return hiscore endpoint
*/
private static HiscoreEndpoint toEndPoint(final AccountType accountType)
{
switch (accountType)
{
case IRONMAN:
return HiscoreEndpoint.IRONMAN;
case ULTIMATE_IRONMAN:
return HiscoreEndpoint.ULTIMATE_IRONMAN;
case HARDCORE_IRONMAN:
return HiscoreEndpoint.HARDCORE_IRONMAN;
default:
return HiscoreEndpoint.NORMAL;
}
}
@Value
private static class HiscoreLookup
{
private final String name;
private final HiscoreEndpoint endpoint;
}
private static String longBossName(String boss)
{
switch (boss.toLowerCase())
{
case "corp":
return "Corporeal Beast";
case "jad":
return "TzTok-Jad";
case "kq":
return "Kalphite Queen";
case "chaos ele":
return "Chaos Elemental";
case "dusk":
case "dawn":
case "gargs":
return "Grotesque Guardians";
case "crazy arch":
return "Crazy Archaeologist";
case "deranged arch":
return "Deranged Archaeologist";
case "mole":
return "Giant Mole";
case "vetion":
return "Vet'ion";
case "vene":
return "Venenatis";
case "kbd":
return "King Black Dragon";
case "vork":
return "Vorkath";
case "sire":
return "Abyssal Sire";
case "smoke devil":
case "thermy":
return "Thermonuclear Smoke Devil";
case "cerb":
return "Cerberus";
case "zuk":
case "inferno":
return "TzKal-Zuk";
case "hydra":
return "Alchemical Hydra";
// gwd
case "sara":
case "saradomin":
case "zilyana":
case "zily":
return "Commander Zilyana";
case "zammy":
case "zamorak":
case "kril":
case "kril trutsaroth":
return "K'ril Tsutsaroth";
case "arma":
case "kree":
case "kreearra":
case "armadyl":
return "Kree'arra";
case "bando":
case "bandos":
case "graardor":
return "General Graardor";
// dks
case "supreme":
return "Dagannoth Supreme";
case "rex":
return "Dagannoth Rex";
case "prime":
return "Dagannoth Prime";
case "wt":
return "Wintertodt";
case "barrows":
return "Barrows Chests";
case "herbi":
return "Herbiboar";
// cox
case "cox":
case "xeric":
case "chambers":
case "olm":
case "raids":
return "Chambers of Xeric";
// cox cm
case "cox cm":
case "xeric cm":
case "chambers cm":
case "olm cm":
case "raids cm":
return "Chambers of Xeric Challenge Mode";
// tob
case "tob":
case "theatre":
case "verzik":
case "verzik vitur":
case "raids 2":
return "Theatre of Blood";
// agility course
case "prif":
case "prifddinas":
return "Prifddinas Agility Course";
// The Gauntlet
case "gaunt":
case "gauntlet":
return "Gauntlet";
// Corrupted Gauntlet
case "cgaunt":
case "cgauntlet":
return "Corrupted Gauntlet";
default:
return WordUtils.capitalize(boss);
}
}
}

View File

@@ -28,8 +28,8 @@ import java.awt.event.KeyEvent;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.ScriptID;
import net.runelite.api.GameState;
import net.runelite.api.ScriptID;
import net.runelite.api.VarClientStr;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.input.KeyListener;

View File

@@ -94,7 +94,7 @@ public class ChatFilterPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -103,7 +103,7 @@ public class ChatFilterPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
filteredPatterns.clear();
client.refreshChat();

View File

@@ -88,6 +88,24 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
private boolean retainChatHistory;
private boolean pmTargetCycling;
/**
* Small hack to prevent plugins checking for specific messages to match. This works because the "—" character
* cannot be seen in-game. This replacement preserves wrapping on chat history messages.
*
* @param message message
* @return message with invisible character before every space
*/
private static String tweakSpaces(final String message)
{
if (message != null)
{
// First replacement cleans up prior applications of this so as not to keep extending the message
return message.replace("", " ").replace(" ", "");
}
return null;
}
@Provides
ChatHistoryConfig getConfig(ConfigManager configManager)
{
@@ -191,22 +209,9 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
}
}
/**
* Small hack to prevent plugins checking for specific messages to match. This works because the "—" character
* cannot be seen in-game. This replacement preserves wrapping on chat history messages.
*
* @param message message
* @return message with invisible character before every space
*/
private static String tweakSpaces(final String message)
@Override
public void keyTyped(KeyEvent e)
{
if (message != null)
{
// First replacement cleans up prior applications of this so as not to keep extending the message
return message.replace("", " ").replace(" ", "");
}
return null;
}
@Override
@@ -239,11 +244,6 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
});
}
@Override
public void keyTyped(KeyEvent e)
{
}
@Override
public void keyReleased(KeyEvent e)
{

View File

@@ -61,6 +61,9 @@ import net.runelite.client.plugins.PluginDescriptor;
@Singleton
public class ChatNotificationsPlugin extends Plugin
{
// Private message cache used to avoid duplicate notifications from ChatHistory.
private final Set<Integer> privateMessageHashes = new HashSet<>();
@Inject
private Client client;
@@ -77,10 +80,6 @@ public class ChatNotificationsPlugin extends Plugin
private Pattern usernameMatcher = null;
private String usernameReplacer = "";
private Pattern highlightMatcher = null;
// Private message cache used to avoid duplicate notifications from ChatHistory.
private final Set<Integer> privateMessageHashes = new HashSet<>();
private boolean highlightOwnName;
private String highlightWordsString;
private boolean notifyOnOwnName;
@@ -89,6 +88,49 @@ public class ChatNotificationsPlugin extends Plugin
private boolean notifyOnDuel;
private boolean notifyOnPm;
/**
* Get the last color tag from a string, or null if there was none
*
* @param str
* @return
*/
private static String getLastColor(String str)
{
int colIdx = str.lastIndexOf("<col=");
int colEndIdx = str.lastIndexOf("</col>");
if (colEndIdx > colIdx)
{
// ends in a </col> which resets the color to normal
return "<col" + ChatColorType.NORMAL + ">";
}
if (colIdx == -1)
{
return null; // no color
}
int closeIdx = str.indexOf('>', colIdx);
if (closeIdx == -1)
{
return null; // unclosed col tag
}
return str.substring(colIdx, closeIdx + 1); // include the >
}
/**
* Strip color tags from a string.
*
* @param str
* @return
*/
@VisibleForTesting
static String stripColor(String str)
{
return str.replaceAll("(<col=[0-9a-f]+>|</col>)", "");
}
@Provides
ChatNotificationsConfig provideConfig(ConfigManager configManager)
{
@@ -315,47 +357,4 @@ public class ChatNotificationsPlugin extends Plugin
return stringBuilder.toString();
}
/**
* Get the last color tag from a string, or null if there was none
*
* @param str
* @return
*/
private static String getLastColor(String str)
{
int colIdx = str.lastIndexOf("<col=");
int colEndIdx = str.lastIndexOf("</col>");
if (colEndIdx > colIdx)
{
// ends in a </col> which resets the color to normal
return "<col" + ChatColorType.NORMAL + ">";
}
if (colIdx == -1)
{
return null; // no color
}
int closeIdx = str.indexOf('>', colIdx);
if (closeIdx == -1)
{
return null; // unclosed col tag
}
return str.substring(colIdx, closeIdx + 1); // include the >
}
/**
* Strip color tags from a string.
*
* @param str
* @return
*/
@VisibleForTesting
static String stripColor(String str)
{
return str.replaceAll("(<col=[0-9a-f]+>|</col>)", "");
}
}

View File

@@ -83,7 +83,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
translator.setInLang(config.publicTargetLanguage());
translator.setOutLang(config.playerTargetLanguage());
@@ -112,7 +112,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
eventBus.unregister(OPTION);
eventBus.unregister(PUBLIC);
@@ -265,6 +265,12 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
client.refreshChat();
}
@Override
public void keyTyped(KeyEvent e)
{
// Nothing.
}
@Override
public void keyPressed(KeyEvent event)
{
@@ -313,10 +319,4 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
{
// Nothing.
}
@Override
public void keyTyped(KeyEvent e)
{
// Nothing.
}
}

View File

@@ -1,5 +1,6 @@
package net.runelite.client.plugins.chattranslation;
import lombok.AccessLevel;
import lombok.Getter;
// TODO: Doesn't Locale pretty much do this as well?
@@ -12,7 +13,7 @@ public enum Languages
FRENCH("French", "fr"),
GERMAN("German", "de");
@Getter
@Getter(AccessLevel.PACKAGE)
private final String name;
private final String shortName;

View File

@@ -23,6 +23,7 @@ class Translator
{
incomingUrlBase = BASE_URL + SOURCE + CENT_URL + lang.toShortString() + LAST_URL;
}
void setOutLang(Languages lang)
{
outgoingUrlBase = BASE_URL + SOURCE + CENT_URL + lang.toShortString() + LAST_URL;
@@ -40,7 +41,7 @@ class Translator
return translate(new URL(url));
}
public String translate(URL url) throws IOException
private String translate(URL url) throws IOException
{
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("User-Agent", "Mozilla/5.0");
@@ -57,10 +58,6 @@ class Translator
return parseResult(response.toString());
}
catch (IOException e)
{
throw e;
}
}
private String parseResult(String inputJson)

View File

@@ -95,6 +95,12 @@ public class ClanChatPlugin extends Plugin
private static final String RECENT_TITLE = "Recent CCs";
private static final int JOIN_LEAVE_DURATION = 20;
private static final int MESSAGE_DELAY = 10;
private static final CopyOnWriteArrayList<Player> clanMembers = new CopyOnWriteArrayList<>();
/**
* queue of temporary messages added to the client
*/
private final Deque<ClanJoinMessage> clanJoinMessages = new ArrayDeque<>();
private final Map<String, ClanMemberActivity> activityBuffer = new HashMap<>();
@Inject
private Client client;
@@ -115,22 +121,8 @@ public class ClanChatPlugin extends Plugin
private ClientThread clientThread;
private List<String> chats = new ArrayList<>();
@SuppressWarnings("unchecked")
public static CopyOnWriteArrayList<Player> getClanMembers()
{
return (CopyOnWriteArrayList<Player>) clanMembers.clone();
}
private static final CopyOnWriteArrayList<Player> clanMembers = new CopyOnWriteArrayList<>();
private ClanChatIndicator clanMemberCounter;
/**
* queue of temporary messages added to the client
*/
private final Deque<ClanJoinMessage> clanJoinMessages = new ArrayDeque<>();
private final Map<String, ClanMemberActivity> activityBuffer = new HashMap<>();
private int clanJoinedTick;
private boolean clanChatIcons;
private boolean recentChats;
private boolean showClanCounter;
@@ -142,6 +134,12 @@ public class ClanChatPlugin extends Plugin
private boolean clanTabChat;
private String clanname;
@SuppressWarnings("unchecked")
public static CopyOnWriteArrayList<Player> getClanMembers()
{
return (CopyOnWriteArrayList<Player>) clanMembers.clone();
}
@Provides
ClanChatConfig getConfig(ConfigManager configManager)
{

View File

@@ -34,6 +34,13 @@ import net.runelite.client.ui.overlay.OverlayManager;
@Singleton
public class ClanManModePlugin extends Plugin
{
final Map<String, Integer> clan = new HashMap<>();
int wildernessLevel;
int clanmin;
int clanmax;
int inwildy;
int ticks;
@Inject
private OverlayManager overlayManager;
@@ -89,15 +96,8 @@ public class ClanManModePlugin extends Plugin
return configManager.getConfig(ClanManModeConfig.class);
}
int wildernessLevel;
int clanmin;
int clanmax;
int inwildy;
int ticks;
final Map<String, Integer> clan = new HashMap<>();
@Override
protected void startUp() throws Exception
protected void startUp()
{
updateConfig();
@@ -107,7 +107,7 @@ public class ClanManModePlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(ClanManModeOverlay);
overlayManager.remove(ClanManModeTileOverlay);

View File

@@ -40,6 +40,7 @@ import java.util.List;
import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.ChatMessageType;
@@ -122,24 +123,24 @@ public class ClueScrollPlugin extends Plugin
13150, 9011,
13151, 9012
};
@Getter
private ClueScroll clue;
@Getter
@Getter(AccessLevel.PUBLIC)
private final List<NPC> npcsToMark = new ArrayList<>();
@Getter
@Getter(AccessLevel.PUBLIC)
private final List<TileObject> objectsToMark = new ArrayList<>();
private final TextComponent textComponent = new TextComponent();
@Getter
@Getter(AccessLevel.PACKAGE)
private ClueScroll clue;
@Getter(AccessLevel.PUBLIC)
private Item[] equippedItems;
@Getter
@Getter(AccessLevel.PUBLIC)
private Item[] inventoryItems;
@Inject
@Getter
@Getter(AccessLevel.PUBLIC)
private Client client;
@Inject
@@ -170,11 +171,33 @@ public class ClueScrollPlugin extends Plugin
private BufferedImage mapArrow;
private Integer clueItemId;
private boolean worldMapPointsSet = false;
private final TextComponent textComponent = new TextComponent();
private boolean displayHintArrows;
/**
* Translate a coordinate either between overworld and real, or real and overworld
*
* @param worldPoint
* @param toOverworld whether to convert to overworld coordinates, or to real coordinates
* @return
*/
public static WorldPoint getMirrorPoint(WorldPoint worldPoint, boolean toOverworld)
{
int region = worldPoint.getRegionID();
for (int i = 0; i < REGION_MIRRORS.length; i += 2)
{
int real = REGION_MIRRORS[i];
int overworld = REGION_MIRRORS[i + 1];
// Test against what we are converting from
if (region == (toOverworld ? real : overworld))
{
return WorldPoint.fromRegion(toOverworld ? overworld : real,
worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane());
}
}
return worldPoint;
}
@Provides
ClueScrollConfig getConfig(ConfigManager configManager)
{
@@ -188,7 +211,7 @@ public class ClueScrollPlugin extends Plugin
}
@Override
protected void startUp() throws Exception
protected void startUp()
{
this.displayHintArrows = config.displayHintArrows();
@@ -199,7 +222,7 @@ public class ClueScrollPlugin extends Plugin
}
@Override
protected void shutDown() throws Exception
protected void shutDown()
{
overlayManager.remove(clueScrollOverlay);
overlayManager.remove(clueScrollEmoteOverlay);
@@ -834,29 +857,4 @@ public class ClueScrollPlugin extends Plugin
newScroll
);
}
/**
* Translate a coordinate either between overworld and real, or real and overworld
*
* @param worldPoint
* @param toOverworld whether to convert to overworld coordinates, or to real coordinates
* @return
*/
public static WorldPoint getMirrorPoint(WorldPoint worldPoint, boolean toOverworld)
{
int region = worldPoint.getRegionID();
for (int i = 0; i < REGION_MIRRORS.length; i += 2)
{
int real = REGION_MIRRORS[i];
int overworld = REGION_MIRRORS[i + 1];
// Test against what we are converting from
if (region == (toOverworld ? real : overworld))
{
return WorldPoint.fromRegion(toOverworld ? overworld : real,
worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane());
}
}
return worldPoint;
}
}

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.NPC;
import net.runelite.api.ObjectID;
@@ -44,7 +45,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueScroll, ObjectClueScroll
{
private static final String ANAGRAM_TEXT = "This anagram reveals who to speak to next: ";

View File

@@ -25,11 +25,12 @@
package net.runelite.client.plugins.cluescrolls.clues;
import com.google.common.collect.ImmutableList;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.widgets.WidgetID;
@Getter
@Getter(AccessLevel.PUBLIC)
public class BeginnerMapClue extends MapClue implements LocationClueScroll
{
private static final ImmutableList<BeginnerMapClue> CLUES = ImmutableList.of(

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.NPC;
import net.runelite.api.coords.WorldPoint;
@@ -39,7 +40,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class CipherClue extends ClueScroll implements TextClueScroll, NpcClueScroll, LocationClueScroll
{
private static final Set<CipherClue> CLUES = ImmutableSet.of(

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableMap;
import java.awt.Color;
import java.awt.Graphics2D;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
@@ -37,7 +38,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class CoordinateClue extends ClueScroll implements TextClueScroll, LocationClueScroll
{
private static final ImmutableMap<WorldPoint, String> CLUES = new ImmutableMap.Builder<WorldPoint, String>()
@@ -206,7 +207,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
@Nullable
private final WorldPoint mirrorLocation;
public CoordinateClue(String text, WorldPoint location, WorldPoint mirrorLocation)
public CoordinateClue(String text, WorldPoint location, @Nullable WorldPoint mirrorLocation)
{
this.text = text;
this.location = location;

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.NPC;
import static net.runelite.api.NullObjectID.NULL_1293;
@@ -47,7 +48,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueScroll, ObjectClueScroll
{
public static final Set<CrypticClue> CLUES = ImmutableSet.of(

View File

@@ -31,10 +31,11 @@ import java.awt.Polygon;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.Client;
import static net.runelite.api.EquipmentInventorySlot.*;
import static net.runelite.api.EquipmentInventorySlot.LEGS;
import static net.runelite.api.EquipmentInventorySlot.*;
import net.runelite.api.Item;
import net.runelite.api.ItemID;
import static net.runelite.api.ItemID.*;
@@ -45,19 +46,23 @@ import net.runelite.api.coords.WorldPoint;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import net.runelite.client.plugins.cluescrolls.clues.emote.Emote;
import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.*;
import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.BULL_ROARER;
import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.*;
import net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit;
import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.*;
import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.SHANTAY_PASS;
import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.*;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.all;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.any;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.emptySlot;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.item;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.range;
import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClueScroll
{
private static final Set<EmoteClue> CLUES = ImmutableSet.of(
@@ -195,7 +200,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
this(text, locationName, stashUnit, location, firstEmote, null, itemRequirements);
}
private EmoteClue(String text, String locationName, STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull ItemRequirement... itemRequirements)
private EmoteClue(String text, String locationName, @Nullable STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull ItemRequirement... itemRequirements)
{
this.text = text;
this.locationName = locationName;

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
@@ -38,7 +39,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class FairyRingClue extends ClueScroll implements TextClueScroll, LocationClueScroll
{
private static final Set<FairyRingClue> CLUES = ImmutableSet.of(

View File

@@ -29,11 +29,12 @@ import java.awt.Color;
import java.awt.Graphics2D;
import java.util.List;
import javax.annotation.Nonnull;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.Item;
import static net.runelite.api.ItemID.*;
import net.runelite.api.NPC;
import net.runelite.api.coords.WorldPoint;
import static net.runelite.api.ItemID.*;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMAGE_Z_OFFSET;
@@ -46,7 +47,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class FaloTheBardClue extends ClueScroll implements TextClueScroll, NpcClueScroll
{
private static final List<FaloTheBardClue> CLUES = ImmutableList.of(

View File

@@ -35,6 +35,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@@ -55,7 +56,7 @@ import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@EqualsAndHashCode(callSuper = false, exclude = {"hotColdSolver", "location"})
@Getter
@Getter(AccessLevel.PUBLIC)
@Slf4j
public class HotColdClue extends ClueScroll implements LocationClueScroll, LocationsClueScroll, TextClueScroll, NpcClueScroll
{

View File

@@ -28,6 +28,7 @@ import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Set;
import lombok.AccessLevel;
import lombok.Getter;
import static net.runelite.api.ItemID.*;
import net.runelite.api.ObjectDefinition;
@@ -49,7 +50,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter
@Getter(AccessLevel.PUBLIC)
public class MapClue extends ClueScroll implements ObjectClueScroll
{
private static final Set<MapClue> CLUES = ImmutableSet.of(

View File

@@ -42,7 +42,7 @@ import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@Getter(AccessLevel.PUBLIC)
public class MusicClue extends ClueScroll implements NpcClueScroll
{
private static final WorldPoint LOCATION = new WorldPoint(2990, 3384, 0);

View File

@@ -25,6 +25,12 @@
package net.runelite.client.plugins.cluescrolls.clues;
import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@@ -32,28 +38,28 @@ import net.runelite.api.EquipmentInventorySlot;
import net.runelite.api.Item;
import net.runelite.api.ItemID;
import net.runelite.api.NPC;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMAGE_Z_OFFSET;
import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollection;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.all;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.any;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.emptySlot;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.item;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.range;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.xOfItem;
import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement;
import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMAGE_Z_OFFSET;
@Getter
@Getter(AccessLevel.PUBLIC)
public class SkillChallengeClue extends ClueScroll implements NpcClueScroll
{
@AllArgsConstructor
@Getter
@Getter(AccessLevel.PRIVATE)
enum ChallengeType
{
CHARLIE("Charlie the Tramp", "Southern Entrance to Varrock"),

View File

@@ -32,6 +32,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.Client;
@@ -42,15 +43,15 @@ import static net.runelite.api.ItemID.TORN_CLUE_SCROLL_PART_2;
import static net.runelite.api.ItemID.TORN_CLUE_SCROLL_PART_3;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ItemContainerChanged;
import net.runelite.api.util.Text;
import net.runelite.client.game.ItemManager;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
import net.runelite.api.util.Text;
@Getter
@Getter(AccessLevel.PUBLIC)
@RequiredArgsConstructor
public class ThreeStepCrypticClue extends ClueScroll implements TextClueScroll, ObjectClueScroll, NpcClueScroll, LocationsClueScroll
{

View File

@@ -24,10 +24,11 @@
*/
package net.runelite.client.plugins.cluescrolls.clues.emote;
import lombok.AccessLevel;
import lombok.Getter;
import static net.runelite.api.SpriteID.*;
@Getter
@Getter(AccessLevel.PUBLIC)
public enum Emote
{
BULL_ROARER("Bull Roarer", -1),

View File

@@ -24,11 +24,12 @@
*/
package net.runelite.client.plugins.cluescrolls.clues.emote;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.NullObjectID;
import net.runelite.api.coords.WorldPoint;
@Getter
@Getter(AccessLevel.PUBLIC)
public enum STASHUnit
{
NEAR_A_SHED_IN_LUMBRIDGE_SWAMP(NullObjectID.NULL_28958, new WorldPoint(3201, 3171, 0)),

View File

@@ -24,11 +24,12 @@
*/
package net.runelite.client.plugins.cluescrolls.clues.hotcold;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
@Getter(AccessLevel.PUBLIC)
public enum HotColdArea
{
ASGARNIA("Asgarnia"),

View File

@@ -27,20 +27,11 @@
package net.runelite.client.plugins.cluescrolls.clues.hotcold;
import java.awt.Rectangle;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.api.coords.WorldPoint;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.ASGARNIA;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.DESERT;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.FELDIP_HILLS;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.FREMENNIK_PROVINCE;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.KANDARIN;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.KARAMJA;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.MISTHALIN;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.MORYTANIA;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.WESTERN_PROVINCE;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.WILDERNESS;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.ZEAH;
import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.*;
// The locations contains all hot/cold points and their descriptions according to the wiki
// these central points were obtained by checking wiki location pictures against a coordinate map
@@ -48,7 +39,7 @@ import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.
// calculations are done considering the 9x9 grid around the central point where the strange device shakes
// because the calculations consider the 9x9 grid, slightly off-center points should still be found by the calculations
@AllArgsConstructor
@Getter
@Getter(AccessLevel.PUBLIC)
public enum HotColdLocation
{
ASGARNIA_WARRIORS(new WorldPoint(2860, 3562, 0), ASGARNIA, "North of the Warriors' Guild in Burthorpe."),

View File

@@ -30,6 +30,7 @@ import java.awt.Rectangle;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.coords.WorldPoint;
@@ -42,7 +43,7 @@ import net.runelite.api.coords.WorldPoint;
* with specific set of solution points, so this solver will filter from a provided set of possible solutions as new
* signals of temperatures and temperature changes are provided.
*/
@Getter
@Getter(AccessLevel.PUBLIC)
public class HotColdSolver
{
private final Set<HotColdLocation> possibleLocations;
@@ -122,7 +123,7 @@ public class HotColdSolver
* @see WorldPoint#distanceTo2D
*/
@VisibleForTesting
static boolean isFirstPointCloserRect(final WorldPoint firstPoint, final WorldPoint secondPoint, final Rectangle rect)
private static boolean isFirstPointCloserRect(final WorldPoint firstPoint, final WorldPoint secondPoint, final Rectangle rect)
{
final WorldPoint nePoint = new WorldPoint((rect.x + rect.width), (rect.y + rect.height), 0);
@@ -160,7 +161,7 @@ public class HotColdSolver
* @see WorldPoint#distanceTo2D
*/
@VisibleForTesting
static boolean isFirstPointCloser(final WorldPoint firstPoint, final WorldPoint secondPoint, final WorldPoint worldPoint)
private static boolean isFirstPointCloser(final WorldPoint firstPoint, final WorldPoint secondPoint, final WorldPoint worldPoint)
{
return firstPoint.distanceTo2D(worldPoint) < secondPoint.distanceTo2D(worldPoint);
}

Some files were not shown because too many files have changed in this diff Show More