client: update itemcontainer api usage
Use new api methods if appropriate
This commit is contained in:
@@ -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