client: update itemcontainer api usage
Use new api methods if appropriate
This commit is contained in:
@@ -30,10 +30,8 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Shape;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Point;
|
||||
@@ -89,16 +87,7 @@ class BlastFurnaceClickBoxOverlay extends Overlay
|
||||
return false;
|
||||
}
|
||||
|
||||
Item[] items = equipmentContainer.getItems();
|
||||
int idx = EquipmentInventorySlot.GLOVES.getSlotIdx();
|
||||
|
||||
if (items == null || idx >= items.length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Item glove = items[idx];
|
||||
return glove != null && glove.getId() == ItemID.ICE_GLOVES;
|
||||
return equipmentContainer.contains(ItemID.ICE_GLOVES);
|
||||
}
|
||||
|
||||
private void renderObject(GameObject object, Graphics2D graphics, Color color)
|
||||
|
||||
@@ -36,12 +36,10 @@ import java.awt.Rectangle;
|
||||
import java.awt.geom.Area;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
@@ -56,6 +54,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.NPC;
|
||||
@@ -321,10 +320,10 @@ public class ClueScrollPlugin extends Plugin
|
||||
// Check if item was removed from inventory
|
||||
if (clue != null && clueItemId != null)
|
||||
{
|
||||
final Stream<Item> items = Arrays.stream(event.getItemContainer().getItems());
|
||||
ItemContainer itemContainer = event.getItemContainer();
|
||||
|
||||
// Check if clue was removed from inventory
|
||||
if (items.noneMatch(item -> itemManager.getItemComposition(item.getId()).getId() == clueItemId))
|
||||
if (!itemContainer.contains(clueItemId))
|
||||
{
|
||||
resetClue(true);
|
||||
}
|
||||
@@ -333,7 +332,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
// if three step clue check for clue scroll pieces
|
||||
if (clue instanceof ThreeStepCrypticClue)
|
||||
{
|
||||
if (((ThreeStepCrypticClue) clue).update(client, event, itemManager))
|
||||
if (((ThreeStepCrypticClue) clue).update(event.getContainerId(), event.getItemContainer()))
|
||||
{
|
||||
worldMapPointsSet = false;
|
||||
npcsToMark.clear();
|
||||
|
||||
@@ -28,21 +28,16 @@ import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import static net.runelite.api.ItemID.TORN_CLUE_SCROLL_PART_1;
|
||||
import static net.runelite.api.ItemID.TORN_CLUE_SCROLL_PART_2;
|
||||
import static net.runelite.api.ItemID.TORN_CLUE_SCROLL_PART_3;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
|
||||
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
@@ -122,26 +117,22 @@ public class ThreeStepCrypticClue extends ClueScroll implements TextClueScroll,
|
||||
}
|
||||
}
|
||||
|
||||
public boolean update(Client client, final ItemContainerChanged event, ItemManager itemManager)
|
||||
public boolean update(int containerId, final ItemContainer itemContainer)
|
||||
{
|
||||
if (event.getItemContainer() == client.getItemContainer(InventoryID.INVENTORY))
|
||||
if (containerId == InventoryID.INVENTORY.getId())
|
||||
{
|
||||
boolean success = false;
|
||||
success |= checkForPart(event, itemManager, TORN_CLUE_SCROLL_PART_1, 0);
|
||||
success |= checkForPart(event, itemManager, TORN_CLUE_SCROLL_PART_2, 1);
|
||||
success |= checkForPart(event, itemManager, TORN_CLUE_SCROLL_PART_3, 2);
|
||||
return success;
|
||||
return checkForPart(itemContainer, TORN_CLUE_SCROLL_PART_1, 0) ||
|
||||
checkForPart(itemContainer, TORN_CLUE_SCROLL_PART_2, 1) ||
|
||||
checkForPart(itemContainer, TORN_CLUE_SCROLL_PART_3, 2);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkForPart(final ItemContainerChanged event, ItemManager itemManager, int clueScrollPart, int index)
|
||||
private boolean checkForPart(final ItemContainer itemContainer, int clueScrollPart, int index)
|
||||
{
|
||||
final Stream<Item> items = Arrays.stream(event.getItemContainer().getItems());
|
||||
|
||||
// If we have the part then that step is done
|
||||
if (items.anyMatch(item -> itemManager.getItemComposition(item.getId()).getId() == clueScrollPart))
|
||||
if (itemContainer.contains(clueScrollPart))
|
||||
{
|
||||
final Map.Entry<CrypticClue, Boolean> entry = clueSteps.get(index);
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ import javax.imageio.ImageIO;
|
||||
import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.RuneLite;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
@@ -147,16 +147,13 @@ public class CustomCursorPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final Item[] items = equipment.getItems();
|
||||
final int weaponIdx = EquipmentInventorySlot.WEAPON.getSlotIdx();
|
||||
|
||||
if (items == null || weaponIdx >= items.length)
|
||||
Item weapon = equipment.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx());
|
||||
if (weapon == null)
|
||||
{
|
||||
clientUI.resetCursor();
|
||||
return;
|
||||
}
|
||||
|
||||
final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()];
|
||||
final BufferedImage image = itemManager.getImage(weapon.getId());
|
||||
|
||||
if (weapon.getQuantity() > 0)
|
||||
|
||||
@@ -251,10 +251,6 @@ public class FishingPlugin extends Plugin
|
||||
|
||||
for (Item item : itemContainer.getItems())
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
switch (item.getId())
|
||||
{
|
||||
case ItemID.DRAGON_HARPOON:
|
||||
|
||||
@@ -320,9 +320,7 @@ public class ItemChargePlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
Item[] items = equipment.getItems();
|
||||
if (EquipmentInventorySlot.RING.getSlotIdx() < items.length
|
||||
&& items[EquipmentInventorySlot.RING.getSlotIdx()].getId() == ItemID.RING_OF_FORGING)
|
||||
if (equipment.contains(ItemID.RING_OF_FORGING))
|
||||
{
|
||||
int charges = Ints.constrainToRange(config.ringOfForging() - 1, 0, MAX_RING_OF_FORGING_CHARGES);
|
||||
updateRingOfForgingCharges(charges);
|
||||
|
||||
@@ -176,11 +176,10 @@ class ItemPricesOverlay extends Overlay
|
||||
}
|
||||
|
||||
// Find the item in the container to get stack size
|
||||
final Item[] items = container.getItems();
|
||||
final int index = menuEntry.getParam0();
|
||||
if (index < items.length)
|
||||
final Item item = container.getItem(index);
|
||||
if (item != null)
|
||||
{
|
||||
final Item item = items[index];
|
||||
return getItemStackValueText(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -245,16 +245,12 @@ public class ItemStatOverlay extends Overlay
|
||||
ItemContainer c = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||
if (s.isEquipable() && currentEquipment != null && c != null)
|
||||
{
|
||||
final Item[] items = c.getItems();
|
||||
final int slot = currentEquipment.getSlot();
|
||||
|
||||
if (slot != -1 && slot < items.length)
|
||||
final Item item = c.getItem(slot);
|
||||
if (item != null)
|
||||
{
|
||||
final Item item = items[slot];
|
||||
if (item != null)
|
||||
{
|
||||
other = itemManager.getItemStats(item.getId(), false);
|
||||
}
|
||||
other = itemManager.getItemStats(item.getId(), false);
|
||||
}
|
||||
|
||||
if (other == null && slot == EquipmentInventorySlot.WEAPON.getSlotIdx())
|
||||
|
||||
@@ -38,14 +38,12 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.FontID;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ScriptPostFired;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
@@ -57,6 +55,7 @@ import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -407,15 +406,7 @@ public class ItemStatPlugin extends Plugin
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (final Item item : inventory.getItems())
|
||||
{
|
||||
if (item.getId() == ItemID.COINS_995)
|
||||
{
|
||||
return item.getQuantity();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return inventory.count(ItemID.COINS_995);
|
||||
}
|
||||
|
||||
private Widget getInventoryContainer()
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
package net.runelite.client.plugins.itemstats.potions;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
@@ -42,8 +43,8 @@ public class PrayerPotion extends StatBoost
|
||||
this.delta = delta;
|
||||
}
|
||||
|
||||
private static final int RING_SLOT = 12;
|
||||
private static final int CAPE_SLOT = 1;
|
||||
private static final int RING_SLOT = EquipmentInventorySlot.RING.getSlotIdx();
|
||||
private static final int CAPE_SLOT = EquipmentInventorySlot.CAPE.getSlotIdx();
|
||||
|
||||
@Override
|
||||
public int heals(Client client)
|
||||
@@ -53,18 +54,19 @@ public class PrayerPotion extends StatBoost
|
||||
ItemContainer equipContainer = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||
if (equipContainer != null)
|
||||
{
|
||||
Item[] equip = equipContainer.getItems();
|
||||
Item cape = equipContainer.getItem(CAPE_SLOT);
|
||||
Item ring = equipContainer.getItem(RING_SLOT);
|
||||
|
||||
hasHolyWrench |= equip.length > RING_SLOT && equip[RING_SLOT].getId() == ItemID.RING_OF_THE_GODS_I;
|
||||
if (equip.length > CAPE_SLOT)
|
||||
hasHolyWrench = ring != null && ring.getId() == ItemID.RING_OF_THE_GODS_I;
|
||||
if (cape != null)
|
||||
{
|
||||
int cape = equip[CAPE_SLOT].getId();
|
||||
hasHolyWrench |= cape == ItemID.PRAYER_CAPE;
|
||||
hasHolyWrench |= cape == ItemID.PRAYER_CAPET;
|
||||
hasHolyWrench |= cape == ItemID.PRAYER_CAPE_10643; // No idea what this is
|
||||
hasHolyWrench |= cape == ItemID.MAX_CAPE;
|
||||
hasHolyWrench |= cape == ItemID.MAX_CAPE_13282; // Or these
|
||||
hasHolyWrench |= cape == ItemID.MAX_CAPE_13342;
|
||||
int capeId = cape.getId();
|
||||
hasHolyWrench |= capeId == ItemID.PRAYER_CAPE;
|
||||
hasHolyWrench |= capeId == ItemID.PRAYER_CAPET;
|
||||
hasHolyWrench |= capeId == ItemID.PRAYER_CAPE_10643; // No idea what this is
|
||||
hasHolyWrench |= capeId == ItemID.MAX_CAPE;
|
||||
hasHolyWrench |= capeId == ItemID.MAX_CAPE_13282; // Or these
|
||||
hasHolyWrench |= capeId == ItemID.MAX_CAPE_13342;
|
||||
}
|
||||
}
|
||||
if (!hasHolyWrench)
|
||||
@@ -75,7 +77,7 @@ public class PrayerPotion extends StatBoost
|
||||
for (Item itemStack : invContainer.getItems())
|
||||
{
|
||||
int item = itemStack.getId();
|
||||
hasHolyWrench |= item == ItemID.HOLY_WRENCH;
|
||||
hasHolyWrench = item == ItemID.HOLY_WRENCH;
|
||||
hasHolyWrench |= item == ItemID.PRAYER_CAPE;
|
||||
hasHolyWrench |= item == ItemID.PRAYER_CAPET;
|
||||
hasHolyWrench |= item == ItemID.PRAYER_CAPE_10643;
|
||||
|
||||
@@ -73,11 +73,11 @@ public class CastleWarsBandage implements Effect
|
||||
return false;
|
||||
}
|
||||
|
||||
final Item[] equipment = equipmentContainer.getItems();
|
||||
final Item gloves = equipmentContainer.getItem(EquipmentInventorySlot.GLOVES.getSlotIdx());
|
||||
|
||||
if (equipment.length > EquipmentInventorySlot.GLOVES.getSlotIdx())
|
||||
if (gloves != null)
|
||||
{
|
||||
return BRACELETS.contains(equipment[EquipmentInventorySlot.GLOVES.getSlotIdx()].getId());
|
||||
return BRACELETS.contains(gloves.getId());
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -31,7 +31,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.TileObject;
|
||||
@@ -91,21 +91,13 @@ public class RoguesDenPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY))
|
||||
if (event.getContainerId() != InventoryID.INVENTORY.getId())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Item item : event.getItemContainer().getItems())
|
||||
{
|
||||
if (item.getId() == ItemID.MYSTIC_JEWEL)
|
||||
{
|
||||
hasGem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hasGem = false;
|
||||
ItemContainer itemContainer = event.getItemContainer();
|
||||
hasGem = itemContainer.contains(ItemID.MYSTIC_JEWEL);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -43,7 +43,6 @@ import net.runelite.api.ItemID;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.DecorativeObjectDespawned;
|
||||
import net.runelite.api.events.DecorativeObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -53,9 +52,22 @@ import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.*;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.AIR_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.BLOOD_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.BODY_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.CHAOS_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.COSMIC_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.DEATH_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.EARTH_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.FIRE_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.LAW_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.MIND_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.NATURE_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.SOUL_RIFT;
|
||||
import static net.runelite.client.plugins.runecraft.AbyssRifts.WATER_RIFT;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -190,7 +202,7 @@ public class RunecraftPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY))
|
||||
if (event.getContainerId() != InventoryID.INVENTORY.getId())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -234,11 +234,6 @@ public class RunEnergyPlugin extends Plugin
|
||||
|
||||
final Item[] items = equipment.getItems();
|
||||
|
||||
if (items == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int boost = 0;
|
||||
|
||||
for (final GracefulEquipmentSlot slot : GracefulEquipmentSlot.values())
|
||||
|
||||
@@ -280,16 +280,12 @@ public class SpecialCounterPlugin extends Plugin
|
||||
return null;
|
||||
}
|
||||
|
||||
Item[] items = equipment.getItems();
|
||||
int weaponIdx = EquipmentInventorySlot.WEAPON.getSlotIdx();
|
||||
|
||||
if (items == null || weaponIdx >= items.length)
|
||||
Item weapon = equipment.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx());
|
||||
if (weapon == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Item weapon = items[weaponIdx];
|
||||
|
||||
for (SpecialWeapon specialWeapon : SpecialWeapon.values())
|
||||
{
|
||||
if (specialWeapon.getItemID() == weapon.getId())
|
||||
|
||||
@@ -798,16 +798,8 @@ public class TimersPlugin extends Plugin
|
||||
ItemContainer container = itemContainerChanged.getItemContainer();
|
||||
if (container == client.getItemContainer(InventoryID.EQUIPMENT))
|
||||
{
|
||||
Item[] items = container.getItems();
|
||||
int weaponIdx = EquipmentInventorySlot.WEAPON.getSlotIdx();
|
||||
Item weapon = container.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx());
|
||||
|
||||
if (items == null || weaponIdx >= items.length)
|
||||
{
|
||||
removeGameTimer(STAFF_OF_THE_DEAD);
|
||||
return;
|
||||
}
|
||||
|
||||
Item weapon = items[weaponIdx];
|
||||
if (weapon == null)
|
||||
{
|
||||
removeGameTimer(STAFF_OF_THE_DEAD);
|
||||
|
||||
@@ -31,9 +31,7 @@ import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
@@ -134,10 +132,7 @@ public class ItemChargePluginTest
|
||||
// Create equipment inventory with ring of forging
|
||||
ItemContainer equipmentItemContainer = mock(ItemContainer.class);
|
||||
when(client.getItemContainer(eq(InventoryID.EQUIPMENT))).thenReturn(equipmentItemContainer);
|
||||
Item[] items = new Item[EquipmentInventorySlot.RING.getSlotIdx() + 1];
|
||||
when(equipmentItemContainer.getItems()).thenReturn(items);
|
||||
Item ring = new Item(ItemID.RING_OF_FORGING, 1);
|
||||
items[EquipmentInventorySlot.RING.getSlotIdx()] = ring;
|
||||
when(equipmentItemContainer.contains(ItemID.RING_OF_FORGING)).thenReturn(true);
|
||||
// Run message
|
||||
chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", USED_RING_OF_FORGING, "", 0);
|
||||
itemChargePlugin.onChatMessage(chatMessage);
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.awt.Color;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.util.Text;
|
||||
@@ -129,7 +128,6 @@ public class ItemStatOverlayTest
|
||||
{
|
||||
// Empty equipment (fully unarmed)
|
||||
final ItemContainer equipment = mock(ItemContainer.class);
|
||||
when(equipment.getItems()).thenReturn(new Item[0]);
|
||||
when(client.getItemContainer(InventoryID.EQUIPMENT)).thenReturn(equipment);
|
||||
|
||||
String tooltip;
|
||||
|
||||
@@ -86,9 +86,7 @@ public class SpecialCounterPluginTest
|
||||
|
||||
// Set up spec weapon
|
||||
ItemContainer equipment = mock(ItemContainer.class);
|
||||
Item[] items = new Item[EquipmentInventorySlot.WEAPON.getSlotIdx() + 1];
|
||||
items[EquipmentInventorySlot.WEAPON.getSlotIdx()] = new Item(ItemID.BANDOS_GODSWORD, 1);
|
||||
when(equipment.getItems()).thenReturn(items);
|
||||
when(equipment.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx())).thenReturn(new Item(ItemID.BANDOS_GODSWORD, 1));
|
||||
when(client.getItemContainer(InventoryID.EQUIPMENT)).thenReturn(equipment);
|
||||
|
||||
// Set up special attack energy
|
||||
|
||||
Reference in New Issue
Block a user