api: deprecate getVar(int) and use getVarbitValue(int)
getVarbitValue was originally for external plugins which could not modify the varbits enum, but now ints are used everywhere it is no longer necessary for two separate methods
This commit is contained in:
@@ -778,9 +778,19 @@ public interface Client extends OAuthApi, GameEngine
|
|||||||
*
|
*
|
||||||
* @param varbit the varbit id
|
* @param varbit the varbit id
|
||||||
* @return the value
|
* @return the value
|
||||||
|
* @see Client#getVarbitValue(int)
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
int getVar(@Varbit int varbit);
|
int getVar(@Varbit int varbit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a value corresponding to the passed varbit.
|
||||||
|
*
|
||||||
|
* @param varbit the varbit id
|
||||||
|
* @return the value
|
||||||
|
*/
|
||||||
|
int getVarbitValue(@Varbit int varbit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an int value corresponding to the passed variable.
|
* Gets an int value corresponding to the passed variable.
|
||||||
*
|
*
|
||||||
@@ -806,15 +816,6 @@ public interface Client extends OAuthApi, GameEngine
|
|||||||
@VisibleForExternalPlugins
|
@VisibleForExternalPlugins
|
||||||
int getVarpValue(int varpId);
|
int getVarpValue(int varpId);
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of a given Varbit.
|
|
||||||
*
|
|
||||||
* @param varbitId the varbit id
|
|
||||||
* @return the value
|
|
||||||
*/
|
|
||||||
@VisibleForExternalPlugins
|
|
||||||
int getVarbitValue(@Varbit int varbitId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of a given VarClientInt
|
* Gets the value of a given VarClientInt
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ public class Perspective
|
|||||||
Widget minimapDrawWidget;
|
Widget minimapDrawWidget;
|
||||||
if (client.isResized())
|
if (client.isResized())
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.SIDE_PANELS) == 1)
|
if (client.getVarbitValue(Varbits.SIDE_PANELS) == 1)
|
||||||
{
|
{
|
||||||
minimapDrawWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_DRAW_AREA);
|
minimapDrawWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_DRAW_AREA);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class ChatMessageManager
|
|||||||
final String channel = stringStack[size - 4];
|
final String channel = stringStack[size - 4];
|
||||||
final ChatMessageType chatMessageType = messageNode.getType();
|
final ChatMessageType chatMessageType = messageNode.getType();
|
||||||
|
|
||||||
final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
final boolean isChatboxTransparent = client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||||
Color usernameColor = null;
|
Color usernameColor = null;
|
||||||
Color channelColor = null;
|
Color channelColor = null;
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ public class ChatMessageManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
boolean isChatboxTransparent = client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||||
Color usernameColor = isChatboxTransparent ? chatColorConfig.transparentPrivateUsernames() : chatColorConfig.opaquePrivateUsernames();
|
Color usernameColor = isChatboxTransparent ? chatColorConfig.transparentPrivateUsernames() : chatColorConfig.opaquePrivateUsernames();
|
||||||
if (usernameColor == null)
|
if (usernameColor == null)
|
||||||
{
|
{
|
||||||
@@ -842,7 +842,7 @@ public class ChatMessageManager
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
String formatRuneLiteMessage(String runeLiteFormatMessage, ChatMessageType type, boolean pmbox)
|
String formatRuneLiteMessage(String runeLiteFormatMessage, ChatMessageType type, boolean pmbox)
|
||||||
{
|
{
|
||||||
final boolean transparentChatbox = client.getVar(Varbits.TRANSPARENT_CHATBOX) != 0;
|
final boolean transparentChatbox = client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) != 0;
|
||||||
final boolean transparent = client.isResized() && transparentChatbox;
|
final boolean transparent = client.isResized() && transparentChatbox;
|
||||||
final Collection<ChatColor> chatColors = colorCache.get(type);
|
final Collection<ChatColor> chatColors = colorCache.get(type);
|
||||||
for (ChatColor chatColor : chatColors)
|
for (ChatColor chatColor : chatColors)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class FavourRequirement implements Requirement
|
|||||||
@Override
|
@Override
|
||||||
public boolean satisfiesRequirement(Client client)
|
public boolean satisfiesRequirement(Client client)
|
||||||
{
|
{
|
||||||
int realFavour = client.getVar(house.getVarbit());
|
int realFavour = client.getVarbitValue(house.getVarbit());
|
||||||
return (realFavour / 10) >= percent;
|
return (realFavour / 10) >= percent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,8 +105,8 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
resetWarnings();
|
resetWarnings();
|
||||||
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||||
equippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
equippedWeaponTypeVarbit = client.getVarbitValue(Varbits.EQUIPPED_WEAPON_TYPE);
|
||||||
castingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
castingModeVarbit = client.getVarbitValue(Varbits.DEFENSIVE_CASTING_MODE);
|
||||||
updateAttackStyle(
|
updateAttackStyle(
|
||||||
equippedWeaponTypeVarbit,
|
equippedWeaponTypeVarbit,
|
||||||
attackStyleVarbit,
|
attackStyleVarbit,
|
||||||
@@ -174,8 +174,8 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int currentAttackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
int currentAttackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||||
int currentEquippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
int currentEquippedWeaponTypeVarbit = client.getVarbitValue(Varbits.EQUIPPED_WEAPON_TYPE);
|
||||||
int currentCastingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
int currentCastingModeVarbit = client.getVarbitValue(Varbits.DEFENSIVE_CASTING_MODE);
|
||||||
|
|
||||||
if (attackStyleVarbit != currentAttackStyleVarbit || equippedWeaponTypeVarbit != currentEquippedWeaponTypeVarbit || castingModeVarbit != currentCastingModeVarbit)
|
if (attackStyleVarbit != currentAttackStyleVarbit || equippedWeaponTypeVarbit != currentEquippedWeaponTypeVarbit || castingModeVarbit != currentCastingModeVarbit)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -788,7 +788,7 @@ public class TabInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getVar(Varbits.BANK_REARRANGE_MODE) == 0)
|
if (client.getVarbitValue(Varbits.BANK_REARRANGE_MODE) == 0)
|
||||||
{
|
{
|
||||||
tabManager.swap(source.getName(), dest.getName());
|
tabManager.swap(source.getName(), dest.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int inGame = client.getVar(Varbits.IN_GAME_BA);
|
int inGame = client.getVarbitValue(Varbits.IN_GAME_BA);
|
||||||
|
|
||||||
if (inGameBit != inGame)
|
if (inGameBit != inGame)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class BarrowsBrotherSlainOverlay extends OverlayPanel
|
|||||||
|
|
||||||
for (BarrowsBrothers brother : BarrowsBrothers.values())
|
for (BarrowsBrothers brother : BarrowsBrothers.values())
|
||||||
{
|
{
|
||||||
final boolean brotherSlain = client.getVar(brother.getKilledVarbit()) > 0;
|
final boolean brotherSlain = client.getVarbitValue(brother.getKilledVarbit()) > 0;
|
||||||
String slain = brotherSlain ? "\u2713" : "\u2717";
|
String slain = brotherSlain ? "\u2713" : "\u2717";
|
||||||
panelComponent.getChildren().add(LineComponent.builder()
|
panelComponent.getChildren().add(LineComponent.builder()
|
||||||
.left(brother.getName())
|
.left(brother.getName())
|
||||||
@@ -109,12 +109,12 @@ class BarrowsBrotherSlainOverlay extends OverlayPanel
|
|||||||
private int rewardPotential()
|
private int rewardPotential()
|
||||||
{
|
{
|
||||||
// this is from [proc,barrows_overlay_reward]
|
// this is from [proc,barrows_overlay_reward]
|
||||||
int brothers = client.getVar(Varbits.BARROWS_KILLED_AHRIM)
|
int brothers = client.getVarbitValue(Varbits.BARROWS_KILLED_AHRIM)
|
||||||
+ client.getVar(Varbits.BARROWS_KILLED_DHAROK)
|
+ client.getVarbitValue(Varbits.BARROWS_KILLED_DHAROK)
|
||||||
+ client.getVar(Varbits.BARROWS_KILLED_GUTHAN)
|
+ client.getVarbitValue(Varbits.BARROWS_KILLED_GUTHAN)
|
||||||
+ client.getVar(Varbits.BARROWS_KILLED_KARIL)
|
+ client.getVarbitValue(Varbits.BARROWS_KILLED_KARIL)
|
||||||
+ client.getVar(Varbits.BARROWS_KILLED_TORAG)
|
+ client.getVarbitValue(Varbits.BARROWS_KILLED_TORAG)
|
||||||
+ client.getVar(Varbits.BARROWS_KILLED_VERAC);
|
+ client.getVarbitValue(Varbits.BARROWS_KILLED_VERAC);
|
||||||
return client.getVar(Varbits.BARROWS_REWARD_POTENTIAL) + brothers * 2;
|
return client.getVarbitValue(Varbits.BARROWS_REWARD_POTENTIAL) + brothers * 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class BarrowsOverlay extends Overlay
|
|||||||
graphics.setColor(Color.black);
|
graphics.setColor(Color.black);
|
||||||
graphics.drawString(brotherLetter, miniMapLocation.getX() + 1, miniMapLocation.getY() + 1);
|
graphics.drawString(brotherLetter, miniMapLocation.getX() + 1, miniMapLocation.getY() + 1);
|
||||||
|
|
||||||
if (client.getVar(brother.getKilledVarbit()) > 0)
|
if (client.getVarbitValue(brother.getKilledVarbit()) > 0)
|
||||||
{
|
{
|
||||||
graphics.setColor(config.deadBrotherLocColor());
|
graphics.setColor(config.deadBrotherLocColor());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class BlastFurnaceClickBoxOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
int dispenserState = client.getVar(Varbits.BAR_DISPENSER);
|
int dispenserState = client.getVarbitValue(Varbits.BAR_DISPENSER);
|
||||||
|
|
||||||
if (config.showConveyorBelt() && plugin.getConveyorBelt() != null)
|
if (config.showConveyorBelt() && plugin.getConveyorBelt() != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class BlastFurnaceCofferOverlay extends OverlayPanel
|
|||||||
|
|
||||||
if (sack != null)
|
if (sack != null)
|
||||||
{
|
{
|
||||||
final int coffer = client.getVar(BLAST_FURNACE_COFFER);
|
final int coffer = client.getVarbitValue(BLAST_FURNACE_COFFER);
|
||||||
|
|
||||||
sack.setHidden(true);
|
sack.setHidden(true);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class BlastFurnaceOverlay extends OverlayPanel
|
|||||||
|
|
||||||
for (BarsOres varbit : BarsOres.values())
|
for (BarsOres varbit : BarsOres.values())
|
||||||
{
|
{
|
||||||
int amount = client.getVar(varbit.getVarbit());
|
int amount = client.getVarbitValue(varbit.getVarbit());
|
||||||
|
|
||||||
if (amount == 0)
|
if (amount == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ class BlastMineOreCountOverlay extends OverlayPanel
|
|||||||
if (config.showOreOverlay())
|
if (config.showOreOverlay())
|
||||||
{
|
{
|
||||||
blastMineWidget.setHidden(true);
|
blastMineWidget.setHidden(true);
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.COAL, client.getVar(Varbits.BLAST_MINE_COAL))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.COAL, client.getVarbitValue(Varbits.BLAST_MINE_COAL))));
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.GOLD_ORE, client.getVar(Varbits.BLAST_MINE_GOLD))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.GOLD_ORE, client.getVarbitValue(Varbits.BLAST_MINE_GOLD))));
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.MITHRIL_ORE, client.getVar(Varbits.BLAST_MINE_MITHRIL))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.MITHRIL_ORE, client.getVarbitValue(Varbits.BLAST_MINE_MITHRIL))));
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.ADAMANTITE_ORE, client.getVar(Varbits.BLAST_MINE_ADAMANTITE))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.ADAMANTITE_ORE, client.getVarbitValue(Varbits.BLAST_MINE_ADAMANTITE))));
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.RUNITE_ORE, client.getVar(Varbits.BLAST_MINE_RUNITE))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.RUNITE_ORE, client.getVarbitValue(Varbits.BLAST_MINE_RUNITE))));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ public class ChatChannelPlugin extends Plugin
|
|||||||
int rankIcon = -1;
|
int rankIcon = -1;
|
||||||
|
|
||||||
// Use configured friends chat info colors if set, otherwise default to the jagex text and fc name colors
|
// Use configured friends chat info colors if set, otherwise default to the jagex text and fc name colors
|
||||||
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
if (client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1)
|
||||||
{
|
{
|
||||||
textColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatInfo(), CHAT_FC_TEXT_TRANSPARENT_BACKGROUND);
|
textColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatInfo(), CHAT_FC_TEXT_TRANSPARENT_BACKGROUND);
|
||||||
channelColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatChannelName(), CHAT_FC_NAME_TRANSPARENT_BACKGROUND);
|
channelColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatChannelName(), CHAT_FC_NAME_TRANSPARENT_BACKGROUND);
|
||||||
@@ -462,7 +462,7 @@ public class ChatChannelPlugin extends Plugin
|
|||||||
|
|
||||||
final Color textColor;
|
final Color textColor;
|
||||||
// Use configured clan chat info colors if set, otherwise default to the jagex text and fc name colors
|
// Use configured clan chat info colors if set, otherwise default to the jagex text and fc name colors
|
||||||
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
if (client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1)
|
||||||
{
|
{
|
||||||
textColor = MoreObjects.firstNonNull(
|
textColor = MoreObjects.firstNonNull(
|
||||||
chatType == MemberActivity.ChatType.CLAN_CHAT ? chatColorConfig.transparentClanChatInfo() : chatColorConfig.transparentClanChatGuestInfo(),
|
chatType == MemberActivity.ChatType.CLAN_CHAT ? chatColorConfig.transparentClanChatInfo() : chatColorConfig.transparentClanChatGuestInfo(),
|
||||||
|
|||||||
@@ -1128,7 +1128,7 @@ public class ChatCommandsPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean gambleCountSubmit(ChatInput chatInput, String value)
|
private boolean gambleCountSubmit(ChatInput chatInput, String value)
|
||||||
{
|
{
|
||||||
final int gc = client.getVar(Varbits.BA_GC);
|
final int gc = client.getVarbitValue(Varbits.BA_GC);
|
||||||
final String playerName = client.getLocalPlayer().getName();
|
final String playerName = client.getLocalPlayer().getName();
|
||||||
|
|
||||||
executor.execute(() ->
|
executor.execute(() ->
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class ClueScrollOverlay extends OverlayPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (clue.isRequiresLight()
|
if (clue.isRequiresLight()
|
||||||
&& ((clue.getFirePitVarbitId() == -1 || client.getVar(clue.getFirePitVarbitId()) != 1)
|
&& ((clue.getFirePitVarbitId() == -1 || client.getVarbitValue(clue.getFirePitVarbitId()) != 1)
|
||||||
&& (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems))
|
&& (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems))
|
||||||
&& (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems))))
|
&& (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems))))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -431,13 +431,13 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
List<Item> items = new ArrayList<>(RUNEPOUCH_AMOUNT_VARBITS.length);
|
List<Item> items = new ArrayList<>(RUNEPOUCH_AMOUNT_VARBITS.length);
|
||||||
for (int i = 0; i < RUNEPOUCH_AMOUNT_VARBITS.length; i++)
|
for (int i = 0; i < RUNEPOUCH_AMOUNT_VARBITS.length; i++)
|
||||||
{
|
{
|
||||||
int amount = client.getVar(RUNEPOUCH_AMOUNT_VARBITS[i]);
|
int amount = client.getVarbitValue(RUNEPOUCH_AMOUNT_VARBITS[i]);
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int varbId = client.getVar(RUNEPOUCH_RUNE_VARBITS[i]);
|
int varbId = client.getVarbitValue(RUNEPOUCH_RUNE_VARBITS[i]);
|
||||||
RunepouchRune rune = RunepouchRune.getRune(varbId);
|
RunepouchRune rune = RunepouchRune.getRune(varbId);
|
||||||
if (rune == null)
|
if (rune == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class CorpDamageOverlay extends OverlayPanel
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int myDamage = client.getVar(Varbits.CORP_DAMAGE);
|
int myDamage = client.getVarbitValue(Varbits.CORP_DAMAGE);
|
||||||
int totalDamage = corpPlugin.getTotalDamage();
|
int totalDamage = corpPlugin.getTotalDamage();
|
||||||
int players = corpPlugin.getPlayers().size();
|
int players = corpPlugin.getPlayers().size();
|
||||||
|
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ public class CorpPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (corp != null)
|
if (corp != null)
|
||||||
{
|
{
|
||||||
int myDamage = client.getVar(Varbits.CORP_DAMAGE);
|
int myDamage = client.getVarbitValue(Varbits.CORP_DAMAGE);
|
||||||
// avoid resetting our counter when the client's is reset
|
// avoid resetting our counter when the client's is reset
|
||||||
if (myDamage > 0)
|
if (myDamage > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class CrowdsourcingCooking
|
|||||||
|
|
||||||
int cookingLevel = client.getBoostedSkillLevel(Skill.COOKING);
|
int cookingLevel = client.getBoostedSkillLevel(Skill.COOKING);
|
||||||
boolean hasCookingGauntlets = hasCookingGauntlets();
|
boolean hasCookingGauntlets = hasCookingGauntlets();
|
||||||
boolean kourendElite = client.getVar(Varbits.DIARY_KOUREND_ELITE) == 1;
|
boolean kourendElite = client.getVarbitValue(Varbits.DIARY_KOUREND_ELITE) == 1;
|
||||||
CookingData data = new CookingData(message, hasCookingGauntlets, inHosidiusKitchen, kourendElite, lastGameObjectClicked, cookingLevel);
|
CookingData data = new CookingData(message, hasCookingGauntlets, inHosidiusKitchen, kourendElite, lastGameObjectClicked, cookingLevel);
|
||||||
manager.storeEvent(data);
|
manager.storeEvent(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ public class CrowdsourcingThieving
|
|||||||
|
|
||||||
private int getArdougneDiary()
|
private int getArdougneDiary()
|
||||||
{
|
{
|
||||||
int easy = client.getVar(Varbits.DIARY_ARDOUGNE_EASY);
|
int easy = client.getVarbitValue(Varbits.DIARY_ARDOUGNE_EASY);
|
||||||
int medium = client.getVar(Varbits.DIARY_ARDOUGNE_MEDIUM);
|
int medium = client.getVarbitValue(Varbits.DIARY_ARDOUGNE_MEDIUM);
|
||||||
int hard = client.getVar(Varbits.DIARY_ARDOUGNE_HARD);
|
int hard = client.getVarbitValue(Varbits.DIARY_ARDOUGNE_HARD);
|
||||||
int elite = client.getVar(Varbits.DIARY_ARDOUGNE_ELITE);
|
int elite = client.getVarbitValue(Varbits.DIARY_ARDOUGNE_ELITE);
|
||||||
return easy + 2 * medium + 4 * hard + 8 * elite;
|
return easy + 2 * medium + 4 * hard + 8 * elite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class CrowdsourcingZMI
|
|||||||
}
|
}
|
||||||
|
|
||||||
int tickDelta = itemContainerChangedTick - illegalActionTick;
|
int tickDelta = itemContainerChangedTick - illegalActionTick;
|
||||||
boolean ardougneMedium = client.getVar(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1;
|
boolean ardougneMedium = client.getVarbitValue(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1;
|
||||||
int runecraftBoostedLevel = client.getBoostedSkillLevel(Skill.RUNECRAFT);
|
int runecraftBoostedLevel = client.getBoostedSkillLevel(Skill.RUNECRAFT);
|
||||||
Multiset<Integer> currentInventorySnapshot = getInventorySnapshot();
|
Multiset<Integer> currentInventorySnapshot = getInventorySnapshot();
|
||||||
final Multiset<Integer> itemsReceived = Multisets.difference(currentInventorySnapshot, previousInventorySnapshot);
|
final Multiset<Integer> itemsReceived = Multisets.difference(currentInventorySnapshot, previousInventorySnapshot);
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (client.getAccountType() == AccountType.NORMAL
|
if (client.getAccountType() == AccountType.NORMAL
|
||||||
&& client.getVar(VarPlayer.NMZ_REWARD_POINTS) >= HERB_BOX_COST
|
&& client.getVar(VarPlayer.NMZ_REWARD_POINTS) >= HERB_BOX_COST
|
||||||
&& (client.getVar(Varbits.DAILY_HERB_BOXES_COLLECTED) < HERB_BOX_MAX
|
&& (client.getVarbitValue(Varbits.DAILY_HERB_BOXES_COLLECTED) < HERB_BOX_MAX
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(HERB_BOX_MESSAGE);
|
sendChatMessage(HERB_BOX_MESSAGE);
|
||||||
@@ -180,8 +180,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkStaves(boolean dailyReset)
|
private void checkStaves(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_VARROCK_EASY) == 1
|
if (client.getVarbitValue(Varbits.DIARY_VARROCK_EASY) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_STAVES_COLLECTED) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_STAVES_COLLECTED) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(STAVES_MESSAGE);
|
sendChatMessage(STAVES_MESSAGE);
|
||||||
@@ -190,8 +190,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkEssence(boolean dailyReset)
|
private void checkEssence(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1
|
if (client.getVarbitValue(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_ESSENCE_COLLECTED) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_ESSENCE_COLLECTED) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(ESSENCE_MESSAGE);
|
sendChatMessage(ESSENCE_MESSAGE);
|
||||||
@@ -200,8 +200,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkRunes(boolean dailyReset)
|
private void checkRunes(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_WILDERNESS_EASY) == 1
|
if (client.getVarbitValue(Varbits.DIARY_WILDERNESS_EASY) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_RUNES_COLLECTED) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_RUNES_COLLECTED) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(RUNES_MESSAGE);
|
sendChatMessage(RUNES_MESSAGE);
|
||||||
@@ -211,8 +211,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
private void checkSand(boolean dailyReset)
|
private void checkSand(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getAccountType() != AccountType.ULTIMATE_IRONMAN
|
if (client.getAccountType() != AccountType.ULTIMATE_IRONMAN
|
||||||
&& client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE
|
&& client.getVarbitValue(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE
|
||||||
&& (client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_SAND_COLLECTED) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(SAND_MESSAGE);
|
sendChatMessage(SAND_MESSAGE);
|
||||||
@@ -221,8 +221,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkFlax(boolean dailyReset)
|
private void checkFlax(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_KANDARIN_EASY) == 1
|
if (client.getVarbitValue(Varbits.DIARY_KANDARIN_EASY) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_FLAX_STATE) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_FLAX_STATE) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(FLAX_MESSAGE);
|
sendChatMessage(FLAX_MESSAGE);
|
||||||
@@ -231,8 +231,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkArrows(boolean dailyReset)
|
private void checkArrows(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_WESTERN_EASY) == 1
|
if (client.getVarbitValue(Varbits.DIARY_WESTERN_EASY) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_ARROWS_STATE) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_ARROWS_STATE) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(ARROWS_MESSAGE);
|
sendChatMessage(ARROWS_MESSAGE);
|
||||||
@@ -241,14 +241,14 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkBonemeal(boolean dailyReset)
|
private void checkBonemeal(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_MORYTANIA_MEDIUM) == 1)
|
if (client.getVarbitValue(Varbits.DIARY_MORYTANIA_MEDIUM) == 1)
|
||||||
{
|
{
|
||||||
int collected = client.getVar(Varbits.DAILY_BONEMEAL_STATE);
|
int collected = client.getVarbitValue(Varbits.DAILY_BONEMEAL_STATE);
|
||||||
int max = BONEMEAL_PER_DIARY;
|
int max = BONEMEAL_PER_DIARY;
|
||||||
if (client.getVar(Varbits.DIARY_MORYTANIA_HARD) == 1)
|
if (client.getVarbitValue(Varbits.DIARY_MORYTANIA_HARD) == 1)
|
||||||
{
|
{
|
||||||
max += BONEMEAL_PER_DIARY;
|
max += BONEMEAL_PER_DIARY;
|
||||||
if (client.getVar(Varbits.DIARY_MORYTANIA_ELITE) == 1)
|
if (client.getVarbitValue(Varbits.DIARY_MORYTANIA_ELITE) == 1)
|
||||||
{
|
{
|
||||||
max += BONEMEAL_PER_DIARY;
|
max += BONEMEAL_PER_DIARY;
|
||||||
}
|
}
|
||||||
@@ -262,8 +262,8 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private void checkDynamite(boolean dailyReset)
|
private void checkDynamite(boolean dailyReset)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.DIARY_KOUREND_MEDIUM) == 1
|
if (client.getVarbitValue(Varbits.DIARY_KOUREND_MEDIUM) == 1
|
||||||
&& (client.getVar(Varbits.DAILY_DYNAMITE_COLLECTED) == 0
|
&& (client.getVarbitValue(Varbits.DAILY_DYNAMITE_COLLECTED) == 0
|
||||||
|| dailyReset))
|
|| dailyReset))
|
||||||
{
|
{
|
||||||
sendChatMessage(DYNAMITE_MESSAGE);
|
sendChatMessage(DYNAMITE_MESSAGE);
|
||||||
|
|||||||
@@ -198,8 +198,8 @@ public class DriftNetPlugin extends Plugin
|
|||||||
|
|
||||||
for (DriftNet net : NETS)
|
for (DriftNet net : NETS)
|
||||||
{
|
{
|
||||||
DriftNetStatus status = DriftNetStatus.of(client.getVar(net.getStatusVarbit()));
|
DriftNetStatus status = DriftNetStatus.of(client.getVarbitValue(net.getStatusVarbit()));
|
||||||
int count = client.getVar(net.getCountVarbit());
|
int count = client.getVarbitValue(net.getCountVarbit());
|
||||||
|
|
||||||
net.setStatus(status);
|
net.setStatus(status);
|
||||||
net.setCount(count);
|
net.setCount(count);
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class XpDropPlugin extends Plugin
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
EnumComposition colorEnum = client.getEnum(EnumID.XPDROP_COLORS);
|
EnumComposition colorEnum = client.getEnum(EnumID.XPDROP_COLORS);
|
||||||
int defaultColorId = client.getVar(Varbits.EXPERIENCE_DROP_COLOR);
|
int defaultColorId = client.getVarbitValue(Varbits.EXPERIENCE_DROP_COLOR);
|
||||||
int color = colorEnum.getIntValue(defaultColorId);
|
int color = colorEnum.getIntValue(defaultColorId);
|
||||||
widget.setTextColor(color);
|
widget.setTextColor(color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ public class FairyRingPlugin extends Plugin
|
|||||||
String destination;
|
String destination;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FairyRings fairyRingDestination = getFairyRingDestination(client.getVar(Varbits.FAIRY_RING_DIAL_ADCB),
|
FairyRings fairyRingDestination = getFairyRingDestination(client.getVarbitValue(Varbits.FAIRY_RING_DIAL_ADCB),
|
||||||
client.getVar(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getVar(Varbits.FAIRY_RING_DIAL_PSRQ));
|
client.getVarbitValue(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getVarbitValue(Varbits.FAIRY_RING_DIAL_PSRQ));
|
||||||
destination = fairyRingDestination.getDestination();
|
destination = fairyRingDestination.getDestination();
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex)
|
catch (IllegalArgumentException ex)
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ public class FishingPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int trawlerContribution = client.getVar(Varbits.FISHING_TRAWLER_ACTIVITY);
|
int trawlerContribution = client.getVarbitValue(Varbits.FISHING_TRAWLER_ACTIVITY);
|
||||||
trawlerContributionWidget.setText("Contribution: " + trawlerContribution);
|
trawlerContributionWidget.setText("Contribution: " + trawlerContribution);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public class HerbiboarPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
for (TrailToSpot trail : spot.getTrails())
|
for (TrailToSpot trail : spot.getTrails())
|
||||||
{
|
{
|
||||||
int value = client.getVar(trail.getVarbitId());
|
int value = client.getVarbitValue(trail.getVarbitId());
|
||||||
|
|
||||||
if (value == trail.getValue())
|
if (value == trail.getValue())
|
||||||
{
|
{
|
||||||
@@ -222,11 +222,11 @@ public class HerbiboarPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finishId = client.getVar(Varbits.HB_FINISH);
|
finishId = client.getVarbitValue(Varbits.HB_FINISH);
|
||||||
|
|
||||||
// The started varbit doesn't get set until the first spot of the rotation has been searched
|
// The started varbit doesn't get set until the first spot of the rotation has been searched
|
||||||
// so we need to use the current group as an indicator of the rotation being started
|
// so we need to use the current group as an indicator of the rotation being started
|
||||||
started = client.getVar(Varbits.HB_STARTED) > 0 || currentGroup != null;
|
started = client.getVarbitValue(Varbits.HB_STARTED) > 0 || currentGroup != null;
|
||||||
boolean finished = !pathActive && started;
|
boolean finished = !pathActive && started;
|
||||||
|
|
||||||
if (!wasStarted && started)
|
if (!wasStarted && started)
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (config.getOxygenThreshold() >= client.getVar(Varbits.OXYGEN_LEVEL) * 0.1)
|
if (config.getOxygenThreshold() >= client.getVarbitValue(Varbits.OXYGEN_LEVEL) * 0.1)
|
||||||
{
|
{
|
||||||
if (!notifyOxygen)
|
if (!notifyOxygen)
|
||||||
{
|
{
|
||||||
@@ -558,7 +558,7 @@ public class IdleNotifierPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
if (client.getRealSkillLevel(Skill.HITPOINTS) > config.getHitpointsThreshold())
|
if (client.getRealSkillLevel(Skill.HITPOINTS) > config.getHitpointsThreshold())
|
||||||
{
|
{
|
||||||
if (client.getBoostedSkillLevel(Skill.HITPOINTS) + client.getVar(Varbits.NMZ_ABSORPTION) <= config.getHitpointsThreshold())
|
if (client.getBoostedSkillLevel(Skill.HITPOINTS) + client.getVarbitValue(Varbits.NMZ_ABSORPTION) <= config.getHitpointsThreshold())
|
||||||
{
|
{
|
||||||
if (!notifyHitpoints)
|
if (!notifyHitpoints)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ public class ItemChargePlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
private void onVarbitChanged(VarbitChanged event)
|
private void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int explorerRingCharge = client.getVar(Varbits.EXPLORER_RING_ALCHS);
|
int explorerRingCharge = client.getVarbitValue(Varbits.EXPLORER_RING_ALCHS);
|
||||||
if (lastExplorerRingCharge != explorerRingCharge)
|
if (lastExplorerRingCharge != explorerRingCharge)
|
||||||
{
|
{
|
||||||
lastExplorerRingCharge = explorerRingCharge;
|
lastExplorerRingCharge = explorerRingCharge;
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public class ItemStatPlugin extends Plugin
|
|||||||
if (event.getScriptId() == ScriptID.GE_OFFERS_SETUP_BUILD && config.geStats())
|
if (event.getScriptId() == ScriptID.GE_OFFERS_SETUP_BUILD && config.geStats())
|
||||||
{
|
{
|
||||||
int currentGeItem = client.getVar(VarPlayer.CURRENT_GE_ITEM);
|
int currentGeItem = client.getVar(VarPlayer.CURRENT_GE_ITEM);
|
||||||
if (currentGeItem != -1 && client.getVar(Varbits.GE_OFFER_CREATION_TYPE) == 0)
|
if (currentGeItem != -1 && client.getVarbitValue(Varbits.GE_OFFER_CREATION_TYPE) == 0)
|
||||||
{
|
{
|
||||||
createItemInformation(currentGeItem);
|
createItemInformation(currentGeItem);
|
||||||
}
|
}
|
||||||
@@ -413,7 +413,7 @@ public class ItemStatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (client.isResized())
|
if (client.isResized())
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.SIDE_PANELS) == 1)
|
if (client.getVarbitValue(Varbits.SIDE_PANELS) == 1)
|
||||||
{
|
{
|
||||||
return client.getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_CONTAINER);
|
return client.getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_CONTAINER);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ public class SpicyStew implements Effect
|
|||||||
/*
|
/*
|
||||||
* Spice boosts listed in the colour order of [Spicy stew -> Smell]
|
* Spice boosts listed in the colour order of [Spicy stew -> Smell]
|
||||||
*/
|
*/
|
||||||
int redBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_RED_SPICES));
|
int redBoost = spiceBoostOf(client.getVarbitValue(Varbits.SPICY_STEW_RED_SPICES));
|
||||||
int yellowBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_YELLOW_SPICES));
|
int yellowBoost = spiceBoostOf(client.getVarbitValue(Varbits.SPICY_STEW_YELLOW_SPICES));
|
||||||
int orangeBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_ORANGE_SPICES));
|
int orangeBoost = spiceBoostOf(client.getVarbitValue(Varbits.SPICY_STEW_ORANGE_SPICES));
|
||||||
int brownBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_BROWN_SPICES));
|
int brownBoost = spiceBoostOf(client.getVarbitValue(Varbits.SPICY_STEW_BROWN_SPICES));
|
||||||
|
|
||||||
List<StatChange> changes = new ArrayList<>();
|
List<StatChange> changes = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class KeyRemappingPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (client.getGameState() == GameState.LOGGED_IN)
|
if (client.getGameState() == GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
final boolean isChatboxTransparent = client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||||
final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND;
|
final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND;
|
||||||
setChatboxWidgetInput(chatboxInput, ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
setChatboxWidgetInput(chatboxInput, ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ public class KingdomPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
final int coffer = client.getVar(Varbits.KINGDOM_COFFER);
|
final int coffer = client.getVarbitValue(Varbits.KINGDOM_COFFER);
|
||||||
final int approval = client.getVar(Varbits.KINGDOM_APPROVAL);
|
final int approval = client.getVarbitValue(Varbits.KINGDOM_APPROVAL);
|
||||||
|
|
||||||
if (client.getGameState() == GameState.LOGGED_IN
|
if (client.getGameState() == GameState.LOGGED_IN
|
||||||
&& isThroneOfMiscellaniaCompleted()
|
&& isThroneOfMiscellaniaCompleted()
|
||||||
|
|||||||
@@ -490,8 +490,8 @@ public class MotherlodePlugin extends Plugin
|
|||||||
|
|
||||||
private void refreshSackValues()
|
private void refreshSackValues()
|
||||||
{
|
{
|
||||||
curSackSize = client.getVar(Varbits.SACK_NUMBER);
|
curSackSize = client.getVarbitValue(Varbits.SACK_NUMBER);
|
||||||
boolean sackUpgraded = client.getVar(Varbits.SACK_UPGRADED) == 1;
|
boolean sackUpgraded = client.getVarbitValue(Varbits.SACK_UPGRADED) == 1;
|
||||||
maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
|
maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class MotherlodeSackOverlay extends OverlayPanel
|
|||||||
|
|
||||||
panelComponent.getChildren().add(LineComponent.builder()
|
panelComponent.getChildren().add(LineComponent.builder()
|
||||||
.left("Pay-dirt in sack:")
|
.left("Pay-dirt in sack:")
|
||||||
.right(String.valueOf(client.getVar(Varbits.SACK_NUMBER)))
|
.right(String.valueOf(client.getVarbitValue(Varbits.SACK_NUMBER)))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -826,7 +826,7 @@ public class MusicPlugin extends Plugin
|
|||||||
int raw = client.getVar(var);
|
int raw = client.getVar(var);
|
||||||
if (raw == 0)
|
if (raw == 0)
|
||||||
{
|
{
|
||||||
raw = -client.getVar(mutedVarbitId);
|
raw = -client.getVarbitValue(mutedVarbitId);
|
||||||
}
|
}
|
||||||
value = raw * this.max / 100;
|
value = raw * this.max / 100;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class NightmareZoneOverlay extends OverlayPanel
|
|||||||
|
|
||||||
renderAbsorptionCounter();
|
renderAbsorptionCounter();
|
||||||
|
|
||||||
final int currentPoints = client.getVar(Varbits.NMZ_POINTS);
|
final int currentPoints = client.getVarbitValue(Varbits.NMZ_POINTS);
|
||||||
final int totalPoints = currentPoints + client.getVar(VarPlayer.NMZ_REWARD_POINTS);
|
final int totalPoints = currentPoints + client.getVar(VarPlayer.NMZ_REWARD_POINTS);
|
||||||
|
|
||||||
panelComponent.getChildren().add(LineComponent.builder()
|
panelComponent.getChildren().add(LineComponent.builder()
|
||||||
@@ -114,7 +114,7 @@ class NightmareZoneOverlay extends OverlayPanel
|
|||||||
|
|
||||||
private void renderAbsorptionCounter()
|
private void renderAbsorptionCounter()
|
||||||
{
|
{
|
||||||
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
int absorptionPoints = client.getVarbitValue(Varbits.NMZ_ABSORPTION);
|
||||||
if (absorptionPoints == 0)
|
if (absorptionPoints == 0)
|
||||||
{
|
{
|
||||||
if (absorptionCounter != null)
|
if (absorptionCounter != null)
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public class NightmareZonePlugin extends Plugin
|
|||||||
|
|
||||||
private void checkAbsorption()
|
private void checkAbsorption()
|
||||||
{
|
{
|
||||||
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
int absorptionPoints = client.getVarbitValue(Varbits.NMZ_ABSORPTION);
|
||||||
|
|
||||||
if (!absorptionNotificationSend)
|
if (!absorptionNotificationSend)
|
||||||
{
|
{
|
||||||
@@ -266,7 +266,7 @@ public class NightmareZonePlugin extends Plugin
|
|||||||
private int calculatePointsPerHour()
|
private int calculatePointsPerHour()
|
||||||
{
|
{
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
final int currentPoints = client.getVar(Varbits.NMZ_POINTS);
|
final int currentPoints = client.getVarbitValue(Varbits.NMZ_POINTS);
|
||||||
|
|
||||||
if (nmzSessionStartTime == null)
|
if (nmzSessionStartTime == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ class OpponentInfoOverlay extends OverlayPanel
|
|||||||
*/
|
*/
|
||||||
private boolean hasHpHud(Actor opponent)
|
private boolean hasHpHud(Actor opponent)
|
||||||
{
|
{
|
||||||
boolean settingEnabled = client.getVar(Varbits.BOSS_HEALTH_OVERLAY) == 0;
|
boolean settingEnabled = client.getVarbitValue(Varbits.BOSS_HEALTH_OVERLAY) == 0;
|
||||||
if (settingEnabled && opponent instanceof NPC)
|
if (settingEnabled && opponent instanceof NPC)
|
||||||
{
|
{
|
||||||
int opponentId = client.getVar(VarPlayer.HP_HUD_NPC_ID);
|
int opponentId = client.getVar(VarPlayer.HP_HUD_NPC_ID);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class PyramidPlunderOverlay extends Overlay
|
|||||||
LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation();
|
LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation();
|
||||||
|
|
||||||
// Highlight convex hulls of urns, chests, and sarcophagus
|
// Highlight convex hulls of urns, chests, and sarcophagus
|
||||||
int currentFloor = client.getVar(Varbits.PYRAMID_PLUNDER_ROOM);
|
int currentFloor = client.getVarbitValue(Varbits.PYRAMID_PLUNDER_ROOM);
|
||||||
for (GameObject object : plugin.getObjectsToHighlight())
|
for (GameObject object : plugin.getObjectsToHighlight())
|
||||||
{
|
{
|
||||||
if (config.highlightUrnsFloor() > currentFloor && URN_IDS.contains(object.getId())
|
if (config.highlightUrnsFloor() > currentFloor && URN_IDS.contains(object.getId())
|
||||||
@@ -127,7 +127,7 @@ class PyramidPlunderOverlay extends Overlay
|
|||||||
if (SPEARTRAP_ID == object.getId())
|
if (SPEARTRAP_ID == object.getId())
|
||||||
{
|
{
|
||||||
// this varbit is set to 1 when you enter a room and 0 once you get passed the spike traps
|
// this varbit is set to 1 when you enter a room and 0 once you get passed the spike traps
|
||||||
if (client.getVar(Varbits.PYRAMID_PLUNDER_ROOM_LOCATION) != 1)
|
if (client.getVarbitValue(Varbits.PYRAMID_PLUNDER_ROOM_LOCATION) != 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class PyramidPlunderPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (timer == null)
|
if (timer == null)
|
||||||
{
|
{
|
||||||
int ppTimer = client.getVar(Varbits.PYRAMID_PLUNDER_TIMER);
|
int ppTimer = client.getVarbitValue(Varbits.PYRAMID_PLUNDER_TIMER);
|
||||||
Duration remaining = PYRAMID_PLUNDER_DURATION.minus(ppTimer, RSTimeUnit.GAME_TICKS);
|
Duration remaining = PYRAMID_PLUNDER_DURATION.minus(ppTimer, RSTimeUnit.GAME_TICKS);
|
||||||
timer = new PyramidPlunderTimer(remaining, itemManager.getImage(PHARAOHS_SCEPTRE), this,
|
timer = new PyramidPlunderTimer(remaining, itemManager.getImage(PHARAOHS_SCEPTRE), this,
|
||||||
config, client);
|
config, client);
|
||||||
@@ -217,6 +217,6 @@ public class PyramidPlunderPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return client.getLocalPlayer() != null
|
return client.getLocalPlayer() != null
|
||||||
&& PYRAMID_PLUNDER_REGION == client.getLocalPlayer().getWorldLocation().getRegionID()
|
&& PYRAMID_PLUNDER_REGION == client.getLocalPlayer().getWorldLocation().getRegionID()
|
||||||
&& client.getVar(Varbits.PYRAMID_PLUNDER_TIMER) > 0;
|
&& client.getVarbitValue(Varbits.PYRAMID_PLUNDER_TIMER) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ class PyramidPlunderTimer extends Timer
|
|||||||
@Override
|
@Override
|
||||||
public String getTooltip()
|
public String getTooltip()
|
||||||
{
|
{
|
||||||
int floor = client.getVar(Varbits.PYRAMID_PLUNDER_ROOM);
|
int floor = client.getVarbitValue(Varbits.PYRAMID_PLUNDER_ROOM);
|
||||||
int thievingLevel = client.getVar(Varbits.PYRAMID_PLUNDER_THIEVING_LEVEL);
|
int thievingLevel = client.getVarbitValue(Varbits.PYRAMID_PLUNDER_THIEVING_LEVEL);
|
||||||
return String.format("Time remaining. Floor: %d. Thieving level: %d", floor, thievingLevel);
|
return String.format("Time remaining. Floor: %d. Thieving level: %d", floor, thievingLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class QuestListPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean isOnQuestTab()
|
private boolean isOnQuestTab()
|
||||||
{
|
{
|
||||||
return client.getVar(Varbits.QUEST_TAB) == 0 && client.getVar(VarClientInt.INVENTORY_TAB) == 2;
|
return client.getVarbitValue(Varbits.QUEST_TAB) == 0 && client.getVar(VarClientInt.INVENTORY_TAB) == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isChatboxOpen()
|
private boolean isChatboxOpen()
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ class RaidsOverlay extends OverlayPanel
|
|||||||
if (plugin.isInRaidChambers())
|
if (plugin.isInRaidChambers())
|
||||||
{
|
{
|
||||||
// If the raid has started
|
// If the raid has started
|
||||||
if (client.getVar(Varbits.RAID_STATE) > 0)
|
if (client.getVarbitValue(Varbits.RAID_STATE) > 0)
|
||||||
{
|
{
|
||||||
if (client.getPlane() == OLM_PLANE)
|
if (client.getPlane() == OLM_PLANE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int tempPartyID = client.getVar(VarPlayer.IN_RAID_PARTY);
|
int tempPartyID = client.getVar(VarPlayer.IN_RAID_PARTY);
|
||||||
boolean tempInRaid = client.getVar(Varbits.IN_RAID) == 1;
|
boolean tempInRaid = client.getVarbitValue(Varbits.IN_RAID) == 1;
|
||||||
|
|
||||||
// if the player's party state has changed
|
// if the player's party state has changed
|
||||||
if (tempPartyID != raidPartyID)
|
if (tempPartyID != raidPartyID)
|
||||||
@@ -321,8 +321,8 @@ public class RaidsPlugin extends Plugin
|
|||||||
|
|
||||||
if (config.pointsMessage())
|
if (config.pointsMessage())
|
||||||
{
|
{
|
||||||
int totalPoints = client.getVar(Varbits.TOTAL_POINTS);
|
int totalPoints = client.getVarbitValue(Varbits.TOTAL_POINTS);
|
||||||
int personalPoints = client.getVar(Varbits.PERSONAL_POINTS);
|
int personalPoints = client.getVarbitValue(Varbits.PERSONAL_POINTS);
|
||||||
|
|
||||||
double percentage = personalPoints / (totalPoints / 100.0);
|
double percentage = personalPoints / (totalPoints / 100.0);
|
||||||
|
|
||||||
@@ -425,7 +425,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
inRaidChambers = client.getVar(Varbits.IN_RAID) == 1;
|
inRaidChambers = client.getVarbitValue(Varbits.IN_RAID) == 1;
|
||||||
|
|
||||||
if (!inRaidChambers)
|
if (!inRaidChambers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ public class RegenMeterPlugin extends Plugin
|
|||||||
ticksPerHPRegen /= 2;
|
ticksPerHPRegen /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getVar(Varbits.LEAGUE_RELIC_3) == TRAILBLAZER_LEAGUE_FLUID_STRIKES_RELIC)
|
if (client.getVarbitValue(Varbits.LEAGUE_RELIC_3) == TRAILBLAZER_LEAGUE_FLUID_STRIKES_RELIC)
|
||||||
{
|
{
|
||||||
ticksPerHPRegen /= 4;
|
ticksPerHPRegen /= 4;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public class RunEnergyPlugin extends Plugin
|
|||||||
final int effectiveWeight = Math.max(client.getWeight(), 0);
|
final int effectiveWeight = Math.max(client.getWeight(), 0);
|
||||||
double lossRate = (Math.min(effectiveWeight, 64) / 100.0) + 0.64;
|
double lossRate = (Math.min(effectiveWeight, 64) / 100.0) + 0.64;
|
||||||
|
|
||||||
if (client.getVar(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) != 0)
|
if (client.getVarbitValue(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) != 0)
|
||||||
{
|
{
|
||||||
lossRate *= 0.3; // Stamina effect reduces energy depletion to 30%
|
lossRate *= 0.3; // Stamina effect reduces energy depletion to 30%
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,14 +90,14 @@ public class RunepouchOverlay extends WidgetItemOverlay
|
|||||||
for (int i = 0; i < AMOUNT_VARBITS.length; i++)
|
for (int i = 0; i < AMOUNT_VARBITS.length; i++)
|
||||||
{
|
{
|
||||||
@Varbit int amountVarbit = AMOUNT_VARBITS[i];
|
@Varbit int amountVarbit = AMOUNT_VARBITS[i];
|
||||||
int amount = client.getVar(amountVarbit);
|
int amount = client.getVarbitValue(amountVarbit);
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Varbit int runeVarbit = RUNE_VARBITS[i];
|
@Varbit int runeVarbit = RUNE_VARBITS[i];
|
||||||
int runeId = client.getVar(runeVarbit);
|
int runeId = client.getVarbitValue(runeVarbit);
|
||||||
RunepouchRune rune = RunepouchRune.getRune(runeId);
|
RunepouchRune rune = RunepouchRune.getRune(runeId);
|
||||||
if (rune == null)
|
if (rune == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -490,14 +490,14 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.screenshotCollectionLogEntries() && chatMessage.startsWith(COLLECTION_LOG_TEXT) && client.getVar(Varbits.COLLECTION_LOG_NOTIFICATION) == 1)
|
if (config.screenshotCollectionLogEntries() && chatMessage.startsWith(COLLECTION_LOG_TEXT) && client.getVarbitValue(Varbits.COLLECTION_LOG_NOTIFICATION) == 1)
|
||||||
{
|
{
|
||||||
String entry = Text.removeTags(chatMessage).substring(COLLECTION_LOG_TEXT.length());
|
String entry = Text.removeTags(chatMessage).substring(COLLECTION_LOG_TEXT.length());
|
||||||
String fileName = "Collection log (" + entry + ")";
|
String fileName = "Collection log (" + entry + ")";
|
||||||
takeScreenshot(fileName, SD_COLLECTION_LOG);
|
takeScreenshot(fileName, SD_COLLECTION_LOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatMessage.contains("combat task") && config.screenshotCombatAchievements() && client.getVar(Varbits.COMBAT_ACHIEVEMENTS_POPUP) == 1)
|
if (chatMessage.contains("combat task") && config.screenshotCombatAchievements() && client.getVarbitValue(Varbits.COMBAT_ACHIEVEMENTS_POPUP) == 1)
|
||||||
{
|
{
|
||||||
String fileName = parseCombatAchievementWidget(chatMessage);
|
String fileName = parseCombatAchievementWidget(chatMessage);
|
||||||
if (!fileName.isEmpty())
|
if (!fileName.isEmpty())
|
||||||
@@ -663,7 +663,7 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
String fileName = "Collection log (" + entry + ")";
|
String fileName = "Collection log (" + entry + ")";
|
||||||
takeScreenshot(fileName, SD_COLLECTION_LOG);
|
takeScreenshot(fileName, SD_COLLECTION_LOG);
|
||||||
}
|
}
|
||||||
if (topText.equalsIgnoreCase("Combat Task Completed!") && config.screenshotCombatAchievements() && client.getVar(Varbits.COMBAT_ACHIEVEMENTS_POPUP) == 0)
|
if (topText.equalsIgnoreCase("Combat Task Completed!") && config.screenshotCombatAchievements() && client.getVarbitValue(Varbits.COMBAT_ACHIEVEMENTS_POPUP) == 0)
|
||||||
{
|
{
|
||||||
String entry = Text.removeTags(bottomText).substring("Task Completed: ".length());
|
String entry = Text.removeTags(bottomText).substring("Task Completed: ".length());
|
||||||
String fileName = "Combat task (" + entry.replaceAll("[:?]", "") + ")";
|
String fileName = "Combat task (" + entry.replaceAll("[:?]", "") + ")";
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ enum SlayerUnlock
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return client.getVar(toggleVarbit) == 0;
|
return client.getVarbitValue(toggleVarbit) == 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class StatusBarsOverlay extends Overlay
|
|||||||
return DISEASE_COLOR;
|
return DISEASE_COLOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getVar(Varbits.PARASITE) >= 1)
|
if (client.getVarbitValue(Varbits.PARASITE) >= 1)
|
||||||
{
|
{
|
||||||
return PARASITE_COLOR;
|
return PARASITE_COLOR;
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ class StatusBarsOverlay extends Overlay
|
|||||||
() -> getRestoreValue("Run Energy"),
|
() -> getRestoreValue("Run Energy"),
|
||||||
() ->
|
() ->
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) != 0)
|
if (client.getVarbitValue(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) != 0)
|
||||||
{
|
{
|
||||||
return RUN_STAMINA_COLOR;
|
return RUN_STAMINA_COLOR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class StatusBarsPlugin extends Plugin
|
|||||||
barsDisplayed = true;
|
barsDisplayed = true;
|
||||||
}
|
}
|
||||||
else if ((interacting instanceof NPC && ArrayUtils.contains(((NPC) interacting).getComposition().getActions(), "Attack"))
|
else if ((interacting instanceof NPC && ArrayUtils.contains(((NPC) interacting).getComposition().getActions(), "Attack"))
|
||||||
|| (interacting instanceof Player && client.getVar(Varbits.PVP_SPEC_ORB) == 1))
|
|| (interacting instanceof Player && client.getVarbitValue(Varbits.PVP_SPEC_ORB) == 1))
|
||||||
{
|
{
|
||||||
lastCombatActionTickCount = client.getTickCount();
|
lastCombatActionTickCount = client.getTickCount();
|
||||||
barsDisplayed = true;
|
barsDisplayed = true;
|
||||||
|
|||||||
@@ -206,13 +206,13 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int raidVarb = client.getVar(Varbits.IN_RAID);
|
int raidVarb = client.getVarbitValue(Varbits.IN_RAID);
|
||||||
int vengCooldownVarb = client.getVar(Varbits.VENGEANCE_COOLDOWN);
|
int vengCooldownVarb = client.getVarbitValue(Varbits.VENGEANCE_COOLDOWN);
|
||||||
int isVengeancedVarb = client.getVar(Varbits.VENGEANCE_ACTIVE);
|
int isVengeancedVarb = client.getVarbitValue(Varbits.VENGEANCE_ACTIVE);
|
||||||
int poisonVarp = client.getVar(VarPlayer.POISON);
|
int poisonVarp = client.getVar(VarPlayer.POISON);
|
||||||
int pvpVarb = client.getVar(Varbits.PVP_SPEC_ORB);
|
int pvpVarb = client.getVarbitValue(Varbits.PVP_SPEC_ORB);
|
||||||
int corruptionCooldownVarb = client.getVar(Varbits.CORRUPTION_COOLDOWN);
|
int corruptionCooldownVarb = client.getVarbitValue(Varbits.CORRUPTION_COOLDOWN);
|
||||||
int imbuedHeartCooldownVarb = client.getVar(Varbits.IMBUED_HEART_COOLDOWN);
|
int imbuedHeartCooldownVarb = client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN);
|
||||||
|
|
||||||
if (lastRaidVarb != raidVarb)
|
if (lastRaidVarb != raidVarb)
|
||||||
{
|
{
|
||||||
@@ -576,7 +576,7 @@ public class TimersPlugin extends Plugin
|
|||||||
|
|
||||||
if (config.showOverload() && message.startsWith("You drink some of your") && message.contains("overload"))
|
if (config.showOverload() && message.startsWith("You drink some of your") && message.contains("overload"))
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.IN_RAID) == 1)
|
if (client.getVarbitValue(Varbits.IN_RAID) == 1)
|
||||||
{
|
{
|
||||||
createGameTimer(OVERLOAD_RAID);
|
createGameTimer(OVERLOAD_RAID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class TimestampPlugin extends Plugin
|
|||||||
|
|
||||||
private Color getTimestampColour()
|
private Color getTimestampColour()
|
||||||
{
|
{
|
||||||
boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
boolean isChatboxTransparent = client.isResized() && client.getVarbitValue(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||||
|
|
||||||
return isChatboxTransparent ? config.transparentTimestamp() : config.opaqueTimestamp();
|
return isChatboxTransparent ? config.transparentTimestamp() : config.opaqueTimestamp();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class FarmingTracker
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
String autoweed = Integer.toString(client.getVar(Varbits.AUTOWEED));
|
String autoweed = Integer.toString(client.getVarbitValue(Varbits.AUTOWEED));
|
||||||
if (!autoweed.equals(configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.AUTOWEED)))
|
if (!autoweed.equals(configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.AUTOWEED)))
|
||||||
{
|
{
|
||||||
configManager.setRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.AUTOWEED, autoweed);
|
configManager.setRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.AUTOWEED, autoweed);
|
||||||
@@ -120,7 +120,7 @@ public class FarmingTracker
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
boolean botanist = client.getVar(Varbits.LEAGUE_RELIC_5) == 1;
|
boolean botanist = client.getVarbitValue(Varbits.LEAGUE_RELIC_5) == 1;
|
||||||
if (!Boolean.valueOf(botanist).equals(configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.BOTANIST, Boolean.class)))
|
if (!Boolean.valueOf(botanist).equals(configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.BOTANIST, Boolean.class)))
|
||||||
{
|
{
|
||||||
configManager.setRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.BOTANIST, botanist);
|
configManager.setRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.BOTANIST, botanist);
|
||||||
@@ -146,7 +146,7 @@ public class FarmingTracker
|
|||||||
// Write the config value if it doesn't match what is current, or it is more than 5 minutes old
|
// Write the config value if it doesn't match what is current, or it is more than 5 minutes old
|
||||||
int varbit = patch.getVarbit();
|
int varbit = patch.getVarbit();
|
||||||
String key = patch.configKey();
|
String key = patch.configKey();
|
||||||
String strVarbit = Integer.toString(client.getVar(varbit));
|
String strVarbit = Integer.toString(client.getVarbitValue(varbit));
|
||||||
String storedValue = configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, key);
|
String storedValue = configManager.getRSProfileConfiguration(TimeTrackingConfig.CONFIG_GROUP, key);
|
||||||
|
|
||||||
if (storedValue != null)
|
if (storedValue != null)
|
||||||
@@ -173,7 +173,7 @@ public class FarmingTracker
|
|||||||
else if (!newRegionLoaded && timeSinceModalClose > 1)
|
else if (!newRegionLoaded && timeSinceModalClose > 1)
|
||||||
{
|
{
|
||||||
PatchState previousPatchState = patch.getImplementation().forVarbitValue(Integer.parseInt(parts[0]));
|
PatchState previousPatchState = patch.getImplementation().forVarbitValue(Integer.parseInt(parts[0]));
|
||||||
PatchState currentPatchState = patch.getImplementation().forVarbitValue(client.getVar(varbit));
|
PatchState currentPatchState = patch.getImplementation().forVarbitValue(client.getVarbitValue(varbit));
|
||||||
|
|
||||||
if (previousPatchState == null || currentPatchState == null)
|
if (previousPatchState == null || currentPatchState == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class WikiPlugin extends Plugin
|
|||||||
children[0] = null;
|
children[0] = null;
|
||||||
|
|
||||||
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
|
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
|
||||||
if (vanilla != null && client.getVar(Varbits.WIKI_ENTITY_LOOKUP) == 0)
|
if (vanilla != null && client.getVarbitValue(Varbits.WIKI_ENTITY_LOOKUP) == 0)
|
||||||
{
|
{
|
||||||
vanilla.setHidden(false);
|
vanilla.setHidden(false);
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ public class WikiPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getVar(Varbits.WIKI_ENTITY_LOOKUP) == 1) // disabled
|
if (client.getVarbitValue(Varbits.WIKI_ENTITY_LOOKUP) == 1) // disabled
|
||||||
{
|
{
|
||||||
// when the wiki entity lookup option is disabled the banner parent layer,
|
// when the wiki entity lookup option is disabled the banner parent layer,
|
||||||
// which is used for var transmit events, is not positioned. This is copied
|
// which is used for var transmit events, is not positioned. This is copied
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class WintertodtPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged varbitChanged)
|
public void onVarbitChanged(VarbitChanged varbitChanged)
|
||||||
{
|
{
|
||||||
int timerValue = client.getVar(Varbits.WINTERTODT_TIMER);
|
int timerValue = client.getVarbitValue(Varbits.WINTERTODT_TIMER);
|
||||||
if (timerValue != previousTimerValue)
|
if (timerValue != previousTimerValue)
|
||||||
{
|
{
|
||||||
int timeToNotify = config.roundNotification();
|
int timeToNotify = config.roundNotification();
|
||||||
|
|||||||
@@ -335,8 +335,8 @@ public class WorldHopperPlugin extends Plugin
|
|||||||
int old1 = favoriteWorld1;
|
int old1 = favoriteWorld1;
|
||||||
int old2 = favoriteWorld2;
|
int old2 = favoriteWorld2;
|
||||||
|
|
||||||
favoriteWorld1 = client.getVar(Varbits.WORLDHOPPER_FAVROITE_1);
|
favoriteWorld1 = client.getVarbitValue(Varbits.WORLDHOPPER_FAVROITE_1);
|
||||||
favoriteWorld2 = client.getVar(Varbits.WORLDHOPPER_FAVROITE_2);
|
favoriteWorld2 = client.getVarbitValue(Varbits.WORLDHOPPER_FAVROITE_2);
|
||||||
|
|
||||||
if (old1 != favoriteWorld1 || old2 != favoriteWorld2)
|
if (old1 != favoriteWorld1 || old2 != favoriteWorld2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,15 +45,15 @@ enum XpWorldType
|
|||||||
@Override
|
@Override
|
||||||
int modifier(Client client)
|
int modifier(Client client)
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.LEAGUE_RELIC_6) != 0)
|
if (client.getVarbitValue(Varbits.LEAGUE_RELIC_6) != 0)
|
||||||
{
|
{
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
if (client.getVar(Varbits.LEAGUE_RELIC_4) != 0)
|
if (client.getVarbitValue(Varbits.LEAGUE_RELIC_4) != 0)
|
||||||
{
|
{
|
||||||
return 12;
|
return 12;
|
||||||
}
|
}
|
||||||
if (client.getVar(Varbits.LEAGUE_RELIC_2) != 0)
|
if (client.getVarbitValue(Varbits.LEAGUE_RELIC_2) != 0)
|
||||||
{
|
{
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -848,7 +848,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
{
|
{
|
||||||
if (client.isResized())
|
if (client.isResized())
|
||||||
{
|
{
|
||||||
if (client.getVar(Varbits.SIDE_PANELS) == 1)
|
if (client.getVarbitValue(Varbits.SIDE_PANELS) == 1)
|
||||||
{
|
{
|
||||||
return client.getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
return client.getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,8 +209,8 @@ public class WidgetOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
// The xptracker component layer isn't hidden if the counter and process bar are both configured "Off",
|
// The xptracker component layer isn't hidden if the counter and process bar are both configured "Off",
|
||||||
// it just has its children hidden.
|
// it just has its children hidden.
|
||||||
if (client.getVar(Varbits.EXPERIENCE_TRACKER_COUNTER) == 30 // Off
|
if (client.getVarbitValue(Varbits.EXPERIENCE_TRACKER_COUNTER) == 30 // Off
|
||||||
&& client.getVar(Varbits.EXPERIENCE_TRACKER_PROGRESS_BAR) == 0) // Off
|
&& client.getVarbitValue(Varbits.EXPERIENCE_TRACKER_PROGRESS_BAR) == 0) // Off
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ public class WidgetOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
|
|
||||||
OverlayPosition position;
|
OverlayPosition position;
|
||||||
switch (client.getVar(Varbits.EXPERIENCE_TRACKER_POSITION))
|
switch (client.getVarbitValue(Varbits.EXPERIENCE_TRACKER_POSITION))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
@@ -269,7 +269,7 @@ public class WidgetOverlay extends Overlay
|
|||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
// Don't draw widget overlay if the PVP KDR stats text will be empty
|
// Don't draw widget overlay if the PVP KDR stats text will be empty
|
||||||
if (client.getVar(Varbits.SHOW_PVP_KDR_STATS) == 1)
|
if (client.getVarbitValue(Varbits.SHOW_PVP_KDR_STATS) == 1)
|
||||||
{
|
{
|
||||||
return super.render(graphics);
|
return super.render(graphics);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class AttackStylesPluginTest
|
|||||||
when(strWidget.isHidden()).thenAnswer(x -> isStrHidden());
|
when(strWidget.isHidden()).thenAnswer(x -> isStrHidden());
|
||||||
|
|
||||||
// equip type_4 weapon type on player
|
// equip type_4 weapon type on player
|
||||||
when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
when(client.getVarbitValue(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
||||||
attackPlugin.onVarbitChanged(new VarbitChanged());
|
attackPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
// Verify there is a warned skill
|
// Verify there is a warned skill
|
||||||
|
|||||||
@@ -216,10 +216,10 @@ public class ClueScrollPluginTest
|
|||||||
when(container.getItems()).thenReturn(inventory);
|
when(container.getItems()).thenReturn(inventory);
|
||||||
when(container.contains(ItemID.RUNE_POUCH)).thenReturn(true);
|
when(container.contains(ItemID.RUNE_POUCH)).thenReturn(true);
|
||||||
|
|
||||||
when(client.getVar(Varbits.RUNE_POUCH_RUNE1)).thenReturn(9); // Cosmic Rune
|
when(client.getVarbitValue(Varbits.RUNE_POUCH_RUNE1)).thenReturn(9); // Cosmic Rune
|
||||||
when(client.getVar(Varbits.RUNE_POUCH_AMOUNT1)).thenReturn(20);
|
when(client.getVarbitValue(Varbits.RUNE_POUCH_AMOUNT1)).thenReturn(20);
|
||||||
when(client.getVar(Varbits.RUNE_POUCH_RUNE3)).thenReturn(4); // Fire Rune
|
when(client.getVarbitValue(Varbits.RUNE_POUCH_RUNE3)).thenReturn(4); // Fire Rune
|
||||||
when(client.getVar(Varbits.RUNE_POUCH_AMOUNT3)).thenReturn(4000);
|
when(client.getVarbitValue(Varbits.RUNE_POUCH_AMOUNT3)).thenReturn(4000);
|
||||||
|
|
||||||
plugin.onItemContainerChanged(event);
|
plugin.onItemContainerChanged(event);
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class MotherlodePluginTest
|
|||||||
motherlodePlugin.onGameStateChanged(gameStateChanged);
|
motherlodePlugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
// Initial sack count
|
// Initial sack count
|
||||||
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(42);
|
when(client.getVarbitValue(Varbits.SACK_NUMBER)).thenReturn(42);
|
||||||
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
// Create before inventory
|
// Create before inventory
|
||||||
@@ -129,7 +129,7 @@ public class MotherlodePluginTest
|
|||||||
when(client.getItemContainer(InventoryID.INVENTORY)).thenReturn(inventory);
|
when(client.getItemContainer(InventoryID.INVENTORY)).thenReturn(inventory);
|
||||||
|
|
||||||
// Withdraw 20
|
// Withdraw 20
|
||||||
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(22);
|
when(client.getVarbitValue(Varbits.SACK_NUMBER)).thenReturn(22);
|
||||||
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
inventory = mock(ItemContainer.class);
|
inventory = mock(ItemContainer.class);
|
||||||
|
|||||||
@@ -427,13 +427,13 @@ public class ScreenshotPluginTest
|
|||||||
{
|
{
|
||||||
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", COLLECTION_LOG_CHAT, null, 0);
|
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", COLLECTION_LOG_CHAT, null, 0);
|
||||||
|
|
||||||
when(client.getVar(Varbits.COLLECTION_LOG_NOTIFICATION)).thenReturn(1);
|
when(client.getVarbitValue(Varbits.COLLECTION_LOG_NOTIFICATION)).thenReturn(1);
|
||||||
screenshotPlugin.onChatMessage(chatMessageEvent);
|
screenshotPlugin.onChatMessage(chatMessageEvent);
|
||||||
|
|
||||||
verify(screenshotPlugin).takeScreenshot("Collection log (Chompy bird hat)", "Collection Log");
|
verify(screenshotPlugin).takeScreenshot("Collection log (Chompy bird hat)", "Collection Log");
|
||||||
reset(screenshotPlugin);
|
reset(screenshotPlugin);
|
||||||
|
|
||||||
when(client.getVar(Varbits.COLLECTION_LOG_NOTIFICATION)).thenReturn(3);
|
when(client.getVarbitValue(Varbits.COLLECTION_LOG_NOTIFICATION)).thenReturn(3);
|
||||||
screenshotPlugin.onChatMessage(chatMessageEvent);
|
screenshotPlugin.onChatMessage(chatMessageEvent);
|
||||||
|
|
||||||
verify(screenshotPlugin, never()).takeScreenshot(anyString(), anyString());
|
verify(screenshotPlugin, never()).takeScreenshot(anyString(), anyString());
|
||||||
@@ -490,7 +490,7 @@ public class ScreenshotPluginTest
|
|||||||
{
|
{
|
||||||
when(screenshotConfig.screenshotCombatAchievements()).thenReturn(true);
|
when(screenshotConfig.screenshotCombatAchievements()).thenReturn(true);
|
||||||
|
|
||||||
when(client.getVar(Varbits.COMBAT_ACHIEVEMENTS_POPUP)).thenReturn(1);
|
when(client.getVarbitValue(Varbits.COMBAT_ACHIEVEMENTS_POPUP)).thenReturn(1);
|
||||||
|
|
||||||
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "",
|
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "",
|
||||||
"Congratulations, you've completed an easy combat task: <col=06600c>Handyman</col>.", null, 0);
|
"Congratulations, you've completed an easy combat task: <col=06600c>Handyman</col>.", null, 0);
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ public class TimersPluginTest
|
|||||||
public void testCorruptionCooldown()
|
public void testCorruptionCooldown()
|
||||||
{
|
{
|
||||||
when(timersConfig.showArceuusCooldown()).thenReturn(true);
|
when(timersConfig.showArceuusCooldown()).thenReturn(true);
|
||||||
when(client.getVar(Varbits.CORRUPTION_COOLDOWN)).thenReturn(1);
|
when(client.getVarbitValue(Varbits.CORRUPTION_COOLDOWN)).thenReturn(1);
|
||||||
timersPlugin.onVarbitChanged(new VarbitChanged());
|
timersPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
|
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
|
||||||
@@ -539,7 +539,7 @@ public class TimersPluginTest
|
|||||||
public void testImbuedHeartStart()
|
public void testImbuedHeartStart()
|
||||||
{
|
{
|
||||||
when(timersConfig.showImbuedHeart()).thenReturn(true);
|
when(timersConfig.showImbuedHeart()).thenReturn(true);
|
||||||
when(client.getVar(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(70);
|
when(client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(70);
|
||||||
timersPlugin.onVarbitChanged(new VarbitChanged());
|
timersPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
|
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
|
||||||
@@ -554,7 +554,7 @@ public class TimersPluginTest
|
|||||||
{
|
{
|
||||||
when(timersConfig.showImbuedHeart()).thenReturn(true);
|
when(timersConfig.showImbuedHeart()).thenReturn(true);
|
||||||
|
|
||||||
when(client.getVar(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(70);
|
when(client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(70);
|
||||||
timersPlugin.onVarbitChanged(new VarbitChanged()); // Calls removeIf once (on createGameTimer)
|
timersPlugin.onVarbitChanged(new VarbitChanged()); // Calls removeIf once (on createGameTimer)
|
||||||
|
|
||||||
ArgumentCaptor<Predicate<InfoBox>> prcaptor = ArgumentCaptor.forClass(Predicate.class);
|
ArgumentCaptor<Predicate<InfoBox>> prcaptor = ArgumentCaptor.forClass(Predicate.class);
|
||||||
@@ -564,7 +564,7 @@ public class TimersPluginTest
|
|||||||
Predicate<InfoBox> pred = prcaptor.getValue();
|
Predicate<InfoBox> pred = prcaptor.getValue();
|
||||||
assertTrue(pred.test(imbuedHeartInfoBox));
|
assertTrue(pred.test(imbuedHeartInfoBox));
|
||||||
|
|
||||||
when(client.getVar(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(0);
|
when(client.getVarbitValue(Varbits.IMBUED_HEART_COOLDOWN)).thenReturn(0);
|
||||||
timersPlugin.onVarbitChanged(new VarbitChanged()); // Calls removeIf once
|
timersPlugin.onVarbitChanged(new VarbitChanged()); // Calls removeIf once
|
||||||
|
|
||||||
verify(infoBoxManager, times(1)).addInfoBox(any());
|
verify(infoBoxManager, times(1)).addInfoBox(any());
|
||||||
|
|||||||
@@ -80,10 +80,10 @@ public class WintertodtPluginTest
|
|||||||
{
|
{
|
||||||
when(config.roundNotification()).thenReturn(15);
|
when(config.roundNotification()).thenReturn(15);
|
||||||
|
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(35);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(35);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
//(15 * 50) / 30 = ~25
|
//(15 * 50) / 30 = ~25
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(25);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(25);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
||||||
@@ -94,10 +94,10 @@ public class WintertodtPluginTest
|
|||||||
{
|
{
|
||||||
when(config.roundNotification()).thenReturn(10);
|
when(config.roundNotification()).thenReturn(10);
|
||||||
|
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(20);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(20);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
//(10 * 50) / 30 = ~16
|
//(10 * 50) / 30 = ~16
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(16);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(16);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
||||||
@@ -108,10 +108,10 @@ public class WintertodtPluginTest
|
|||||||
{
|
{
|
||||||
when(config.roundNotification()).thenReturn(5);
|
when(config.roundNotification()).thenReturn(5);
|
||||||
|
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(10);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(10);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
//(5 * 50) / 30 = ~8
|
//(5 * 50) / 30 = ~8
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(8);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(8);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
||||||
@@ -122,17 +122,17 @@ public class WintertodtPluginTest
|
|||||||
{
|
{
|
||||||
when(config.roundNotification()).thenReturn(5);
|
when(config.roundNotification()).thenReturn(5);
|
||||||
|
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(0);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(0);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(10);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(10);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(8);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(8);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(6);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(6);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(5);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(5);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(4);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(4);
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
verify(notifier, times(1)).notify("Wintertodt round is about to start");
|
||||||
@@ -142,7 +142,7 @@ public class WintertodtPluginTest
|
|||||||
public void matchStartingNotification_shouldNotNotify_whenNoneOptionSelected()
|
public void matchStartingNotification_shouldNotNotify_whenNoneOptionSelected()
|
||||||
{
|
{
|
||||||
when(config.roundNotification()).thenReturn(5);
|
when(config.roundNotification()).thenReturn(5);
|
||||||
when(client.getVar(Varbits.WINTERTODT_TIMER)).thenReturn(25);
|
when(client.getVarbitValue(Varbits.WINTERTODT_TIMER)).thenReturn(25);
|
||||||
|
|
||||||
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
wintertodtPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
verify(notifier, times(0)).notify("Wintertodt round is about to start");
|
verify(notifier, times(0)).notify("Wintertodt round is about to start");
|
||||||
|
|||||||
Reference in New Issue
Block a user