api: replace varbits enum with ints
This adds a Varbit magic constant annotation which is used now on varbit parameters and fields. This is roughly the same type-safety wise, with IDE support, but the ids can be inlined by the compiler and it avoids having to have a large enum class with many fields.
This commit is contained in:
@@ -28,6 +28,7 @@ import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@@ -37,7 +38,6 @@ public class FavourRequirement implements Requirement
|
||||
* An enumeration of Kourend house favour the player can earn.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum Favour
|
||||
{
|
||||
ARCEUUS("Arceuus", Varbits.KOUREND_FAVOR_ARCEUUS),
|
||||
@@ -46,8 +46,10 @@ public class FavourRequirement implements Requirement
|
||||
PISCARILIUS("Piscarilius", Varbits.KOUREND_FAVOR_PISCARILIUS),
|
||||
SHAYZIEN("Shayzien", Varbits.KOUREND_FAVOR_SHAYZIEN);
|
||||
|
||||
@Getter
|
||||
private final String name;
|
||||
private final Varbits varbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int varbit;
|
||||
}
|
||||
|
||||
private final Favour house;
|
||||
|
||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.barrows;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@@ -42,5 +43,6 @@ enum BarrowsBrothers
|
||||
|
||||
private final String name;
|
||||
private final WorldPoint location;
|
||||
private final Varbits killedVarbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int killedVarbit;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@@ -51,6 +52,7 @@ enum BarsOres
|
||||
SILVER_BAR(Varbits.BLAST_FURNACE_SILVER_BAR, ItemID.SILVER_BAR),
|
||||
GOLD_BAR(Varbits.BLAST_FURNACE_GOLD_BAR, ItemID.GOLD_BAR);
|
||||
|
||||
private final Varbits varbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int varbit;
|
||||
private final int itemID;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ClueScrollOverlay extends OverlayPanel
|
||||
}
|
||||
|
||||
if (clue.isRequiresLight()
|
||||
&& ((clue.getHasFirePit() == null || client.getVar(clue.getHasFirePit()) != 1)
|
||||
&& ((clue.getFirePitVarbitId() == -1 || client.getVar(clue.getFirePitVarbitId()) != 1)
|
||||
&& (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems))
|
||||
&& (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems))))
|
||||
{
|
||||
|
||||
@@ -145,10 +145,10 @@ public class ClueScrollPlugin extends Plugin
|
||||
private static final Color HIGHLIGHT_HOVER_BORDER_COLOR = HIGHLIGHT_BORDER_COLOR.darker();
|
||||
private static final Color HIGHLIGHT_FILL_COLOR = new Color(0, 255, 0, 20);
|
||||
private static final String CLUE_TAG_NAME = "clue";
|
||||
private static final Varbits[] RUNEPOUCH_AMOUNT_VARBITS = {
|
||||
private static final int[] RUNEPOUCH_AMOUNT_VARBITS = {
|
||||
Varbits.RUNE_POUCH_AMOUNT1, Varbits.RUNE_POUCH_AMOUNT2, Varbits.RUNE_POUCH_AMOUNT3
|
||||
};
|
||||
private static final Varbits[] RUNEPOUCH_RUNE_VARBITS = {
|
||||
private static final int[] RUNEPOUCH_RUNE_VARBITS = {
|
||||
Varbits.RUNE_POUCH_RUNE1, Varbits.RUNE_POUCH_RUNE2, Varbits.RUNE_POUCH_RUNE3
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.awt.Graphics2D;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
@@ -43,8 +43,8 @@ public abstract class ClueScroll
|
||||
private boolean requiresLight;
|
||||
|
||||
@Setter(AccessLevel.PROTECTED)
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
private Varbits hasFirePit;
|
||||
@Getter(onMethod_ = {@Varbit}, value = AccessLevel.PUBLIC)
|
||||
private int firePitVarbitId = -1;
|
||||
|
||||
@Setter(AccessLevel.PROTECTED)
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
|
||||
@@ -32,14 +32,21 @@ import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.ANCIENT_WIZARDS;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.ARMADYLEAN_GUARD;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.ARMADYLEAN_OR_BANDOSIAN_GUARD;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.BANDOSIAN_GUARD;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.BRASSICAN_MAGE;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.SARADOMIN_WIZARD;
|
||||
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.ZAMORAK_WIZARD;
|
||||
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 static net.runelite.client.plugins.cluescrolls.clues.Enemy.*;
|
||||
|
||||
@Getter
|
||||
public class CoordinateClue extends ClueScroll implements TextClueScroll, LocationClueScroll
|
||||
@@ -49,7 +56,8 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
{
|
||||
private final String directions;
|
||||
private final boolean lightRequired;
|
||||
private final Varbits lightSource;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int lightSourceVarbitId;
|
||||
private final Enemy enemy;
|
||||
|
||||
private CoordinateClueInfo(@NonNull String directions)
|
||||
@@ -62,15 +70,15 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
this.directions = directions;
|
||||
this.enemy = enemy;
|
||||
this.lightRequired = false;
|
||||
this.lightSource = null;
|
||||
this.lightSourceVarbitId = -1;
|
||||
}
|
||||
|
||||
private CoordinateClueInfo(@Nonnull String directions, Enemy enemy, boolean lightRequired, Varbits lightSource)
|
||||
private CoordinateClueInfo(@Nonnull String directions, Enemy enemy, boolean lightRequired, @Varbit int lightSourceVarbitId)
|
||||
{
|
||||
this.directions = directions;
|
||||
this.enemy = enemy;
|
||||
this.lightRequired = lightRequired;
|
||||
this.lightSource = lightSource;
|
||||
this.lightSourceVarbitId = lightSourceVarbitId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +265,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
final CoordinateClueInfo clueInfo = CLUES.get(location);
|
||||
if (clueInfo != null)
|
||||
{
|
||||
setHasFirePit(clueInfo.getLightSource());
|
||||
setFirePitVarbitId(clueInfo.getLightSourceVarbitId());
|
||||
setRequiresLight(clueInfo.lightRequired);
|
||||
setEnemy(clueInfo.getEnemy());
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import static net.runelite.api.ItemID.*;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
|
||||
@@ -253,11 +254,11 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
|
||||
this.itemRequirements = itemRequirements;
|
||||
}
|
||||
|
||||
private EmoteClue(String text, String locationName, @Nullable STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull Varbits firePit, @Nonnull ItemRequirement... itemRequirements)
|
||||
private EmoteClue(String text, String locationName, @Nullable STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Varbit int firePitVarbitId, @Nonnull ItemRequirement... itemRequirements)
|
||||
{
|
||||
this(text, locationName, stashUnit, location, firstEmote, secondEmote, itemRequirements);
|
||||
setRequiresLight(true);
|
||||
setHasFirePit(firePit);
|
||||
setFirePitVarbitId(firePitVarbitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
package net.runelite.client.plugins.devtools;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.inject.Inject;
|
||||
import java.awt.BorderLayout;
|
||||
@@ -32,6 +33,7 @@ import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.AdjustmentListener;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -45,6 +47,7 @@ import javax.swing.JScrollPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.IndexDataBase;
|
||||
import net.runelite.api.VarClientInt;
|
||||
@@ -62,6 +65,7 @@ import net.runelite.client.ui.ColorScheme;
|
||||
import net.runelite.client.ui.DynamicGridLayout;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
|
||||
@Slf4j
|
||||
class VarInspector extends DevToolsFrame
|
||||
{
|
||||
@Getter
|
||||
@@ -84,6 +88,26 @@ class VarInspector extends DevToolsFrame
|
||||
|
||||
private final static int MAX_LOG_ENTRIES = 10_000;
|
||||
private static final int VARBITS_ARCHIVE_ID = 14;
|
||||
private static final Map<Integer, String> VARBIT_NAMES;
|
||||
|
||||
static
|
||||
{
|
||||
ImmutableMap.Builder<Integer, String> builder = new ImmutableMap.Builder<>();
|
||||
|
||||
try
|
||||
{
|
||||
for (Field f : Varbits.class.getDeclaredFields())
|
||||
{
|
||||
builder.put(f.getInt(null), f.getName());
|
||||
}
|
||||
}
|
||||
catch (IllegalAccessException ex)
|
||||
{
|
||||
log.error("error setting up varbit names", ex);
|
||||
}
|
||||
|
||||
VARBIT_NAMES = builder.build();
|
||||
}
|
||||
|
||||
private final Client client;
|
||||
private final ClientThread clientThread;
|
||||
@@ -218,15 +242,7 @@ class VarInspector extends DevToolsFrame
|
||||
// Example: 4101 collides with 4104-4129
|
||||
client.setVarbitValue(oldVarps2, i, neew);
|
||||
|
||||
String name = Integer.toString(i);
|
||||
for (Varbits varbit : Varbits.values())
|
||||
{
|
||||
if (varbit.getId() == i)
|
||||
{
|
||||
name = String.format("%s(%d)", varbit.name(), i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
final String name = VARBIT_NAMES.getOrDefault(i, Integer.toString(i));
|
||||
addVarLog(VarType.VARBIT, name, old, neew);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,10 +27,11 @@ package net.runelite.client.plugins.driftnet;
|
||||
|
||||
import java.util.Set;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
@Data
|
||||
@@ -38,8 +39,10 @@ import net.runelite.api.coords.WorldPoint;
|
||||
class DriftNet
|
||||
{
|
||||
private final int objectId;
|
||||
private final Varbits statusVarbit;
|
||||
private final Varbits countVarbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int statusVarbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int countVarbit;
|
||||
private final Set<WorldPoint> adjacentTiles;
|
||||
|
||||
private GameObject net;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
{
|
||||
for (TrailToSpot trail : spot.getTrails())
|
||||
{
|
||||
int value = client.getVar(trail.getVarbit());
|
||||
int value = client.getVar(trail.getVarbitId());
|
||||
|
||||
if (value == trail.getValue())
|
||||
{
|
||||
|
||||
@@ -27,8 +27,9 @@ package net.runelite.client.plugins.herbiboars;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.Value;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
|
||||
/**
|
||||
* A representation of a trail of footsteps which appears when hunting for the Herbiboar.
|
||||
@@ -42,9 +43,10 @@ class TrailToSpot
|
||||
* equal to that of {@link TrailToSpot#getValue()}. Once the next object along the trail has been searched, this
|
||||
* Varbit's value will be greater than that of {@link TrailToSpot#getValue()}.
|
||||
*/
|
||||
private final Varbits varbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int varbitId;
|
||||
/**
|
||||
* The cutoff reference value to compare against the value of {@link TrailToSpot#getVarbit()} to determine its state
|
||||
* The cutoff reference value to compare against the value of {@link TrailToSpot#getVarbitId()} ()} to determine its state
|
||||
* along the current trail.
|
||||
*/
|
||||
private final int value;
|
||||
|
||||
@@ -59,6 +59,7 @@ import net.runelite.api.StructID;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.events.AreaSoundEffectPlayed;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.ClientTick;
|
||||
@@ -783,7 +784,8 @@ public class MusicPlugin extends Plugin
|
||||
@Getter
|
||||
private final String name;
|
||||
private final VarPlayer var;
|
||||
private final Varbits mutedVar;
|
||||
@Varbit
|
||||
private final int mutedVarbitId;
|
||||
private final IntSupplier getter;
|
||||
private final Consumer<Integer> setter;
|
||||
private final IntConsumer volumeChanger;
|
||||
@@ -797,14 +799,14 @@ public class MusicPlugin extends Plugin
|
||||
private Slider windowSlider;
|
||||
|
||||
Channel(String name,
|
||||
VarPlayer var, Varbits mutedVar,
|
||||
VarPlayer var, @Varbit int mutedVarbitId,
|
||||
IntSupplier getter, Consumer<Integer> setter,
|
||||
IntConsumer volumeChanger, int max,
|
||||
WidgetInfo sideRoot)
|
||||
{
|
||||
this.name = name;
|
||||
this.var = var;
|
||||
this.mutedVar = mutedVar;
|
||||
this.mutedVarbitId = mutedVarbitId;
|
||||
this.getter = getter;
|
||||
this.setter = setter;
|
||||
this.volumeChanger = volumeChanger;
|
||||
@@ -824,7 +826,7 @@ public class MusicPlugin extends Plugin
|
||||
int raw = client.getVar(var);
|
||||
if (raw == 0)
|
||||
{
|
||||
raw = -client.getVar(mutedVar);
|
||||
raw = -client.getVar(mutedVarbitId);
|
||||
}
|
||||
value = raw * this.max / 100;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.RunepouchRune;
|
||||
@@ -47,12 +48,10 @@ import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public class RunepouchOverlay extends WidgetItemOverlay
|
||||
{
|
||||
private static final Varbits[] AMOUNT_VARBITS =
|
||||
{
|
||||
private static final int[] AMOUNT_VARBITS = {
|
||||
Varbits.RUNE_POUCH_AMOUNT1, Varbits.RUNE_POUCH_AMOUNT2, Varbits.RUNE_POUCH_AMOUNT3
|
||||
};
|
||||
private static final Varbits[] RUNE_VARBITS =
|
||||
{
|
||||
private static final int[] RUNE_VARBITS = {
|
||||
Varbits.RUNE_POUCH_RUNE1, Varbits.RUNE_POUCH_RUNE2, Varbits.RUNE_POUCH_RUNE3
|
||||
};
|
||||
private static final Dimension IMAGE_SIZE = new Dimension(11, 11);
|
||||
@@ -60,16 +59,15 @@ public class RunepouchOverlay extends WidgetItemOverlay
|
||||
private final Client client;
|
||||
private final RunepouchConfig config;
|
||||
private final TooltipManager tooltipManager;
|
||||
private final ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
RunepouchOverlay(Client client, RunepouchConfig config, TooltipManager tooltipManager)
|
||||
RunepouchOverlay(Client client, RunepouchConfig config, TooltipManager tooltipManager, ItemManager itemManager)
|
||||
{
|
||||
this.tooltipManager = tooltipManager;
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
this.itemManager = itemManager;
|
||||
showOnInventory();
|
||||
showOnBank();
|
||||
}
|
||||
@@ -91,15 +89,14 @@ public class RunepouchOverlay extends WidgetItemOverlay
|
||||
|
||||
for (int i = 0; i < AMOUNT_VARBITS.length; i++)
|
||||
{
|
||||
Varbits amountVarbit = AMOUNT_VARBITS[i];
|
||||
|
||||
@Varbit int amountVarbit = AMOUNT_VARBITS[i];
|
||||
int amount = client.getVar(amountVarbit);
|
||||
if (amount <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Varbits runeVarbit = RUNE_VARBITS[i];
|
||||
@Varbit int runeVarbit = RUNE_VARBITS[i];
|
||||
int runeId = client.getVar(runeVarbit);
|
||||
RunepouchRune rune = RunepouchRune.getRune(runeId);
|
||||
if (rune == null)
|
||||
|
||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.slayer;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
|
||||
/**
|
||||
* Unlockables in the slayer interface
|
||||
@@ -87,17 +88,19 @@ enum SlayerUnlock
|
||||
VAMPYRE_EXTEND(49),
|
||||
VAMPYRE_UNLOCK(50);
|
||||
|
||||
private final Varbits toggleVarbit;
|
||||
@Varbit
|
||||
private final int toggleVarbit;
|
||||
|
||||
SlayerUnlock(int index)
|
||||
{
|
||||
this(index, null);
|
||||
assert index == ordinal();
|
||||
this.toggleVarbit = -1;
|
||||
}
|
||||
|
||||
SlayerUnlock(int index, Varbits toggleVarbit)
|
||||
SlayerUnlock(int index, @Varbit int varbit)
|
||||
{
|
||||
assert index == ordinal();
|
||||
this.toggleVarbit = toggleVarbit;
|
||||
this.toggleVarbit = varbit;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +119,7 @@ enum SlayerUnlock
|
||||
{
|
||||
if (isOwned(client))
|
||||
{
|
||||
if (toggleVarbit == null)
|
||||
if (toggleVarbit == -1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.annotations.Varbit;
|
||||
import net.runelite.client.plugins.timetracking.TimeTrackingConfig;
|
||||
|
||||
@RequiredArgsConstructor(
|
||||
@@ -40,16 +40,17 @@ class FarmingPatch
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private FarmingRegion region;
|
||||
private final String name;
|
||||
private final Varbits varbit;
|
||||
@Getter(onMethod_ = {@Varbit})
|
||||
private final int varbit;
|
||||
private final PatchImplementation implementation;
|
||||
|
||||
String configKey()
|
||||
{
|
||||
return region.getRegionID() + "." + varbit.getId();
|
||||
return region.getRegionID() + "." + varbit;
|
||||
}
|
||||
|
||||
String notifyConfigKey()
|
||||
{
|
||||
return TimeTrackingConfig.NOTIFY + "." + region.getRegionID() + "." + varbit.getId();
|
||||
return TimeTrackingConfig.NOTIFY + "." + region.getRegionID() + "." + varbit;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public class FarmingTracker
|
||||
for (FarmingPatch patch : region.getPatches())
|
||||
{
|
||||
// Write the config value if it doesn't match what is current, or it is more than 5 minutes old
|
||||
Varbits varbit = patch.getVarbit();
|
||||
int varbit = patch.getVarbit();
|
||||
String key = patch.configKey();
|
||||
String strVarbit = Integer.toString(client.getVar(varbit));
|
||||
String storedValue = configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, key);
|
||||
|
||||
Reference in New Issue
Block a user