Merge branch 'master' of https://github.com/runelite-extended/runelite
This commit is contained in:
@@ -61,6 +61,7 @@ import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginInstantiationException;
|
||||
import net.runelite.client.plugins.PluginManager;
|
||||
import net.runelite.client.rs.ClientLoader;
|
||||
import net.runelite.client.rs.ClientUpdateCheckMode;
|
||||
import net.runelite.client.task.Scheduler;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
@@ -183,6 +184,7 @@ public class RuneLite
|
||||
parser.accepts("developer-mode", "Enable developer tools");
|
||||
parser.accepts("debug", "Show extra debugging output");
|
||||
parser.accepts("no-splash", "Do not show the splash screen");
|
||||
parser.accepts("local-injected", "Use local injected-client");
|
||||
|
||||
final ArgumentAcceptingOptionSpec<String> proxyInfo = parser
|
||||
.accepts("proxy")
|
||||
@@ -261,6 +263,11 @@ public class RuneLite
|
||||
logger.setLevel(Level.DEBUG);
|
||||
}
|
||||
|
||||
if (options.has("local-injected"))
|
||||
{
|
||||
ClientLoader.useLocalInjected = true;
|
||||
}
|
||||
|
||||
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) ->
|
||||
{
|
||||
log.error("Uncaught exception:", throwable);
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.Client;
|
||||
import static net.runelite.api.Constants.CLIENT_DEFAULT_ZOOM;
|
||||
import static net.runelite.api.Constants.HIGH_ALCHEMY_CONSTANT;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import static net.runelite.api.ItemID.AGILITY_CAPE;
|
||||
import static net.runelite.api.ItemID.AGILITY_CAPET;
|
||||
@@ -159,9 +159,9 @@ import static net.runelite.api.ItemID.SPOTTED_CAPE;
|
||||
import static net.runelite.api.ItemID.SPOTTED_CAPE_10073;
|
||||
import static net.runelite.api.ItemID.SPOTTIER_CAPE;
|
||||
import static net.runelite.api.ItemID.SPOTTIER_CAPE_10074;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.PostItemComposition;
|
||||
import net.runelite.api.events.PostItemDefinition;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.http.api.item.ItemClient;
|
||||
@@ -196,7 +196,7 @@ public class ItemManager
|
||||
private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
|
||||
private Map<Integer, ItemStats> itemStats = Collections.emptyMap();
|
||||
private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages;
|
||||
private final LoadingCache<Integer, ItemComposition> itemCompositions;
|
||||
private final LoadingCache<Integer, ItemDefinition> itemDefinitions;
|
||||
private final LoadingCache<OutlineKey, BufferedImage> itemOutlines;
|
||||
|
||||
// Worn items with weight reducing property have a different worn and inventory ItemID
|
||||
@@ -284,13 +284,13 @@ public class ItemManager
|
||||
}
|
||||
});
|
||||
|
||||
itemCompositions = CacheBuilder.newBuilder()
|
||||
itemDefinitions = CacheBuilder.newBuilder()
|
||||
.maximumSize(1024L)
|
||||
.expireAfterAccess(1, TimeUnit.HOURS)
|
||||
.build(new CacheLoader<Integer, ItemComposition>()
|
||||
.build(new CacheLoader<Integer, ItemDefinition>()
|
||||
{
|
||||
@Override
|
||||
public ItemComposition load(Integer key) throws Exception
|
||||
public ItemDefinition load(Integer key) throws Exception
|
||||
{
|
||||
return client.getItemDefinition(key);
|
||||
}
|
||||
@@ -356,24 +356,24 @@ public class ItemManager
|
||||
{
|
||||
if (event.getGameState() == GameState.HOPPING || event.getGameState() == GameState.LOGIN_SCREEN)
|
||||
{
|
||||
itemCompositions.invalidateAll();
|
||||
itemDefinitions.invalidateAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPostItemComposition(PostItemComposition event)
|
||||
public void onPostItemDefinition(PostItemDefinition event)
|
||||
{
|
||||
itemCompositions.put(event.getItemComposition().getId(), event.getItemComposition());
|
||||
itemDefinitions.put(event.getItemDefinition().getId(), event.getItemDefinition());
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates internal item manager item composition cache (but not client item composition cache)
|
||||
*
|
||||
* @see Client#getItemCompositionCache()
|
||||
* @see Client#getItemDefinitionCache()
|
||||
*/
|
||||
public void invalidateItemCompositionCache()
|
||||
public void invalidateItemDefinitionCache()
|
||||
{
|
||||
itemCompositions.invalidateAll();
|
||||
itemDefinitions.invalidateAll();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -412,7 +412,7 @@ public class ItemManager
|
||||
return price;
|
||||
}
|
||||
|
||||
public int getAlchValue(ItemComposition composition)
|
||||
public int getAlchValue(ItemDefinition composition)
|
||||
{
|
||||
if (composition.getId() == ItemID.COINS_995)
|
||||
{
|
||||
@@ -437,7 +437,7 @@ public class ItemManager
|
||||
return 1000;
|
||||
}
|
||||
|
||||
return (int) Math.max(1, getItemComposition(itemID).getPrice() * HIGH_ALCHEMY_CONSTANT);
|
||||
return (int) Math.max(1, getItemDefinition(itemID).getPrice() * HIGH_ALCHEMY_CONSTANT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,9 +449,9 @@ public class ItemManager
|
||||
@Nullable
|
||||
public ItemStats getItemStats(int itemId, boolean allowNote)
|
||||
{
|
||||
ItemComposition itemComposition = getItemComposition(itemId);
|
||||
ItemDefinition itemDefinition = getItemDefinition(itemId);
|
||||
|
||||
if (itemComposition == null || itemComposition.getName() == null || (!allowNote && itemComposition.getNote() != -1))
|
||||
if (itemDefinition == null || itemDefinition.getName() == null || (!allowNote && itemDefinition.getNote() != -1))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -487,10 +487,10 @@ public class ItemManager
|
||||
* @param itemId item id
|
||||
* @return item composition
|
||||
*/
|
||||
public ItemComposition getItemComposition(int itemId)
|
||||
public ItemDefinition getItemDefinition(int itemId)
|
||||
{
|
||||
assert client.isClientThread() : "getItemComposition must be called on client thread";
|
||||
return itemCompositions.getUnchecked(itemId);
|
||||
assert client.isClientThread() : "getItemDefinition must be called on client thread";
|
||||
return itemDefinitions.getUnchecked(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -498,16 +498,16 @@ public class ItemManager
|
||||
*/
|
||||
public int canonicalize(int itemID)
|
||||
{
|
||||
ItemComposition itemComposition = getItemComposition(itemID);
|
||||
ItemDefinition itemDefinition = getItemDefinition(itemID);
|
||||
|
||||
if (itemComposition.getNote() != -1)
|
||||
if (itemDefinition.getNote() != -1)
|
||||
{
|
||||
return itemComposition.getLinkedNoteId();
|
||||
return itemDefinition.getLinkedNoteId();
|
||||
}
|
||||
|
||||
if (itemComposition.getPlaceholderTemplateId() != -1)
|
||||
if (itemDefinition.getPlaceholderTemplateId() != -1)
|
||||
{
|
||||
return itemComposition.getPlaceholderId();
|
||||
return itemDefinition.getPlaceholderId();
|
||||
}
|
||||
|
||||
return WORN_ITEMS.getOrDefault(itemID, itemID);
|
||||
@@ -528,7 +528,7 @@ public class ItemManager
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SpritePixels sprite = client.createItemSprite(itemId, quantity, 1, SpritePixels.DEFAULT_SHADOW_COLOR,
|
||||
Sprite sprite = client.createItemSprite(itemId, quantity, 1, Sprite.DEFAULT_SHADOW_COLOR,
|
||||
stackable ? 1 : 0, false, CLIENT_DEFAULT_ZOOM);
|
||||
if (sprite == null)
|
||||
{
|
||||
@@ -589,7 +589,7 @@ public class ItemManager
|
||||
*/
|
||||
private BufferedImage loadItemOutline(final int itemId, final int itemQuantity, final Color outlineColor)
|
||||
{
|
||||
final SpritePixels itemSprite = client.createItemSprite(itemId, itemQuantity, 1, 0, 0, true, 710);
|
||||
final Sprite itemSprite = client.createItemSprite(itemId, itemQuantity, 1, 0, 0, true, 710);
|
||||
return itemSprite.toBufferedOutline(outlineColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ public class LootManager
|
||||
|
||||
final int x = location.getSceneX();
|
||||
final int y = location.getSceneY();
|
||||
final int size = npc.getComposition().getSize();
|
||||
final int size = npc.getDefinition().getSize();
|
||||
|
||||
// Some NPCs drop items onto multiple tiles
|
||||
final List<ItemStack> allItems = new ArrayList<>();
|
||||
|
||||
@@ -40,7 +40,7 @@ import javax.swing.SwingUtilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SpriteManager
|
||||
return cached;
|
||||
}
|
||||
|
||||
SpritePixels[] sp = client.getSprites(client.getIndexSprites(), archive, 0);
|
||||
Sprite[] sp = client.getSprites(client.getIndexSprites(), archive, 0);
|
||||
BufferedImage img = sp[file].toBufferedImage();
|
||||
|
||||
cache.put(key, img);
|
||||
@@ -141,12 +141,12 @@ public class SpriteManager
|
||||
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
Map<Integer, SpritePixels> overrides = client.getSpriteOverrides();
|
||||
Map<Integer, Sprite> overrides = client.getSpriteOverrides();
|
||||
Class<?> owner = add[0].getClass();
|
||||
for (SpriteOverride o : add)
|
||||
{
|
||||
BufferedImage image = ImageUtil.getResourceStreamFromClass(owner, o.getFileName());
|
||||
SpritePixels sp = ImageUtil.getImageSpritePixels(image, client);
|
||||
Sprite sp = ImageUtil.getImageSprite(image, client);
|
||||
overrides.put(o.getSpriteId(), sp);
|
||||
}
|
||||
});
|
||||
@@ -156,7 +156,7 @@ public class SpriteManager
|
||||
{
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
Map<Integer, SpritePixels> overrides = client.getSpriteOverrides();
|
||||
Map<Integer, Sprite> overrides = client.getSpriteOverrides();
|
||||
for (SpriteOverride o : remove)
|
||||
{
|
||||
overrides.remove(o.getSpriteId());
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.MainBufferProvider;
|
||||
import net.runelite.api.Model;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -934,7 +934,7 @@ public class ModelOutlineRenderer
|
||||
Color innerColor, Color outerColor)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = npc.getTransformedComposition();
|
||||
NPCDefinition composition = npc.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
|
||||
@@ -45,8 +45,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.NpcActionChanged;
|
||||
@@ -291,14 +291,14 @@ public class MenuManager
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectComposition oc = client.getObjectDefinition(objectID);
|
||||
ObjectDefinition oc = client.getObjectDefinition(objectID);
|
||||
|
||||
if (oc == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectComposition impostor = oc.getImpostorIds() != null ? oc.getImpostor() : null;
|
||||
ObjectDefinition impostor = oc.getImpostorIds() != null ? oc.getImpostor() : null;
|
||||
|
||||
if (impostor != null)
|
||||
{
|
||||
@@ -390,14 +390,14 @@ public class MenuManager
|
||||
@Subscribe
|
||||
public void onNpcActionChanged(NpcActionChanged event)
|
||||
{
|
||||
NPCComposition composition = event.getNpcComposition();
|
||||
NPCDefinition composition = event.getNpcDefinition();
|
||||
for (String npcOption : npcMenuOptions)
|
||||
{
|
||||
addNpcOption(composition, npcOption);
|
||||
}
|
||||
}
|
||||
|
||||
private void addNpcOption(NPCComposition composition, String npcOption)
|
||||
private void addNpcOption(NPCDefinition composition, String npcOption)
|
||||
{
|
||||
String[] actions = composition.getActions();
|
||||
int unused = -1;
|
||||
@@ -419,7 +419,7 @@ public class MenuManager
|
||||
actions[unused] = npcOption;
|
||||
}
|
||||
|
||||
private void removeNpcOption(NPCComposition composition, String npcOption)
|
||||
private void removeNpcOption(NPCDefinition composition, String npcOption)
|
||||
{
|
||||
String[] actions = composition.getActions();
|
||||
|
||||
@@ -709,7 +709,7 @@ public class MenuManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds to the map of swaps - Pre-baked Abstract entry
|
||||
* Adds to the map of swaps - Pre-baked entry
|
||||
*/
|
||||
public void addSwap(ComparableEntry swapFrom, ComparableEntry swapTo)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
@@ -100,7 +100,7 @@ public class AmmoPlugin extends Plugin
|
||||
if (items.length > EquipmentInventorySlot.WEAPON.getSlotIdx())
|
||||
{
|
||||
final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()];
|
||||
final ItemComposition weaponComp = itemManager.getItemComposition(weapon.getId());
|
||||
final ItemDefinition weaponComp = itemManager.getItemDefinition(weapon.getId());
|
||||
if (weaponComp.isStackable())
|
||||
{
|
||||
updateInfobox(weapon, weaponComp);
|
||||
@@ -115,7 +115,7 @@ public class AmmoPlugin extends Plugin
|
||||
}
|
||||
|
||||
final Item ammo = items[EquipmentInventorySlot.AMMO.getSlotIdx()];
|
||||
final ItemComposition comp = itemManager.getItemComposition(ammo.getId());
|
||||
final ItemDefinition comp = itemManager.getItemDefinition(ammo.getId());
|
||||
|
||||
if (!comp.isStackable())
|
||||
{
|
||||
@@ -126,7 +126,7 @@ public class AmmoPlugin extends Plugin
|
||||
updateInfobox(ammo, comp);
|
||||
}
|
||||
|
||||
private void updateInfobox(final Item item, final ItemComposition comp)
|
||||
private void updateInfobox(final Item item, final ItemDefinition comp)
|
||||
{
|
||||
if (counterBox != null && counterBox.getItemID() == item.getId())
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
@@ -211,7 +211,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
|
||||
// not a placeholder
|
||||
else if (itemManager.getItemComposition(itemId).getPlaceholderTemplateId() == -1)
|
||||
else if (itemManager.getItemDefinition(itemId).getPlaceholderTemplateId() == -1)
|
||||
{
|
||||
// return true
|
||||
intStack[intStackSize - 2] = 1;
|
||||
@@ -344,8 +344,8 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
|
||||
int itemId = item.getId();
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
String name = itemComposition.getName();
|
||||
ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId);
|
||||
String name = itemDefinition.getName();
|
||||
|
||||
// Get both tags and vartags and append * to end of vartags name
|
||||
Collection<String> tags = tagManager.getTags(itemId, false);
|
||||
|
||||
@@ -52,7 +52,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
@@ -577,7 +577,7 @@ public class TabInterface
|
||||
{
|
||||
if (event.getMenuOption().startsWith(CHANGE_ICON + " ("))
|
||||
{
|
||||
ItemComposition item = getItem(event.getActionParam());
|
||||
ItemDefinition item = getItem(event.getActionParam());
|
||||
int itemId = itemManager.canonicalize(item.getId());
|
||||
iconToSet.setIconItemId(itemId);
|
||||
iconToSet.getIcon().setItemId(itemId);
|
||||
@@ -611,7 +611,7 @@ public class TabInterface
|
||||
{
|
||||
// Add "remove" menu entry to all items in bank while tab is selected
|
||||
event.consume();
|
||||
final ItemComposition item = getItem(event.getActionParam());
|
||||
final ItemDefinition item = getItem(event.getActionParam());
|
||||
final int itemId = item.getId();
|
||||
tagManager.removeTag(itemId, activeTab.getTag());
|
||||
bankSearch.search(InputType.SEARCH, TAG_SEARCH + activeTab.getTag(), true);
|
||||
@@ -1000,11 +1000,11 @@ public class TabInterface
|
||||
}
|
||||
|
||||
|
||||
private ItemComposition getItem(int idx)
|
||||
private ItemDefinition getItem(int idx)
|
||||
{
|
||||
ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK);
|
||||
Item item = bankContainer.getItems()[idx];
|
||||
return itemManager.getItemComposition(item.getId());
|
||||
return itemManager.getItemDefinition(item.getId());
|
||||
}
|
||||
|
||||
private void openTag(final String tag)
|
||||
|
||||
@@ -33,8 +33,8 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.WallObject;
|
||||
@@ -78,7 +78,7 @@ class BarrowsOverlay extends Overlay
|
||||
final List<NPC> npcs = client.getNpcs();
|
||||
for (NPC npc : npcs)
|
||||
{
|
||||
final NPCComposition composition = npc.getComposition();
|
||||
final NPCDefinition composition = npc.getDefinition();
|
||||
|
||||
if (composition != null && !composition.isMinimapVisible())
|
||||
{
|
||||
@@ -163,8 +163,8 @@ class BarrowsOverlay extends Overlay
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectComposition objectComp = client.getObjectDefinition(wall.getId());
|
||||
ObjectComposition impostor = objectComp.getImpostorIds() != null ? objectComp.getImpostor() : null;
|
||||
ObjectDefinition objectComp = client.getObjectDefinition(wall.getId());
|
||||
ObjectDefinition impostor = objectComp.getImpostorIds() != null ? objectComp.getImpostor() : null;
|
||||
|
||||
if (impostor != null && impostor.getActions()[0] != null)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ class BarrowsOverlay extends Overlay
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectComposition objectComp = client.getObjectDefinition(ladder.getId());
|
||||
ObjectDefinition objectComp = client.getObjectDefinition(ladder.getId());
|
||||
|
||||
if (objectComp.getImpostorIds() != null && objectComp.getImpostor() != null)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.chatcommands;
|
||||
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import com.google.inject.Provides;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@@ -38,7 +39,7 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Experience;
|
||||
import net.runelite.api.IconID;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
@@ -46,7 +47,6 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import static net.runelite.api.widgets.WidgetID.KILL_LOGS_GROUP_ID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -700,7 +700,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
builder.append(ChatColorType.HIGHLIGHT);
|
||||
builder.append(StackFormatter.formatNumber(osbresult.getOverall_average()));
|
||||
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
if (itemComposition != null)
|
||||
{
|
||||
int alchPrice = itemManager.getAlchValue(itemId);
|
||||
|
||||
@@ -120,8 +120,10 @@ public class ChatFilterPlugin extends Plugin
|
||||
}
|
||||
|
||||
MessageNode messageNode = (MessageNode) client.getMessages().get(messageId);
|
||||
String name = messageNode.getName();
|
||||
if (!shouldFilterPlayerMessage(name))
|
||||
|
||||
if (client.getLocalPlayer().getName().equals(messageNode.getName()) ||
|
||||
!config.filterFriends() && messageNode.isFromFriend() ||
|
||||
!config.filterClan() && messageNode.isFromClanMate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ import net.runelite.api.GameObject;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Scene;
|
||||
import net.runelite.api.ScriptID;
|
||||
@@ -227,7 +227,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
{
|
||||
if (event.getMenuOption() != null && event.getMenuOption().equals("Read"))
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(event.getId());
|
||||
|
||||
if (itemComposition != null && itemComposition.getName().startsWith("Clue scroll"))
|
||||
{
|
||||
@@ -652,8 +652,8 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
|
||||
// Check impostors
|
||||
final ObjectComposition comp = client.getObjectDefinition(object.getId());
|
||||
final ObjectComposition impostor = comp.getImpostorIds() != null ? comp.getImpostor() : comp;
|
||||
final ObjectDefinition comp = client.getObjectDefinition(object.getId());
|
||||
final ObjectDefinition impostor = comp.getImpostorIds() != null ? comp.getImpostor() : comp;
|
||||
|
||||
if (impostor != null && impostor.getId() == id)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.NPC;
|
||||
import static net.runelite.api.NullObjectID.NULL_1293;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import static net.runelite.api.ObjectID.*;
|
||||
import net.runelite.api.TileObject;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -371,7 +371,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
|
||||
|
||||
if (objectId != -1)
|
||||
{
|
||||
ObjectComposition object = plugin.getClient().getObjectDefinition(objectId);
|
||||
ObjectDefinition object = plugin.getClient().getObjectDefinition(objectId);
|
||||
|
||||
if (object != null && object.getImpostorIds() != null)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.awt.Graphics2D;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import static net.runelite.api.ItemID.*;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import static net.runelite.api.ObjectID.CRATE_18506;
|
||||
import static net.runelite.api.ObjectID.CRATE_2620;
|
||||
import static net.runelite.api.ObjectID.CRATE_354;
|
||||
@@ -127,7 +127,7 @@ public class MapClue extends ClueScroll implements ObjectClueScroll
|
||||
|
||||
if (objectId != -1)
|
||||
{
|
||||
ObjectComposition objectToClick = plugin.getClient().getObjectDefinition(getObjectId());
|
||||
ObjectDefinition objectToClick = plugin.getClient().getObjectDefinition(getObjectId());
|
||||
|
||||
String objectName = "N/A";
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ package net.runelite.client.plugins.cluescrolls.clues.emote;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
|
||||
public class SingleItemRequirement implements ItemRequirement
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public class SingleItemRequirement implements ItemRequirement
|
||||
@Override
|
||||
public String getCollectiveName(Client client)
|
||||
{
|
||||
ItemComposition definition = client.getItemDefinition(itemId);
|
||||
ItemDefinition definition = client.getItemDefinition(itemId);
|
||||
|
||||
if (definition == null)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Hitsplat;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
@@ -267,7 +267,7 @@ public class CombatCounter extends Plugin
|
||||
* This part handles the Tick Counter.
|
||||
*/
|
||||
long ticks = variables.get(animation);
|
||||
if (((Player) actor).getPlayerComposition().getEquipmentId(KitType.WEAPON) == 23360)
|
||||
if (((Player) actor).getPlayerAppearance().getEquipmentId(KitType.WEAPON) == 23360)
|
||||
{
|
||||
ticks = 3;
|
||||
}
|
||||
@@ -556,7 +556,7 @@ public class CombatCounter extends Plugin
|
||||
public int calculateDistance(Player p, NPC npc)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition comp = npc.getTransformedComposition();
|
||||
NPCDefinition comp = npc.getTransformedDefinition();
|
||||
if (comp != null)
|
||||
{
|
||||
size = comp.getSize();
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -118,7 +118,7 @@ public class CookingPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged graphicChanged)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
Player player = client.getLocalPlayer();
|
||||
|
||||
@@ -127,7 +127,7 @@ public class CookingPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGraphic() == GraphicID.WINE_MAKE && config.fermentTimer())
|
||||
if (player.getSpotAnimation() == GraphicID.WINE_MAKE && config.fermentTimer())
|
||||
{
|
||||
Optional<FermentTimer> fermentTimerOpt = infoBoxManager.getInfoBoxes().stream()
|
||||
.filter(FermentTimer.class::isInstance)
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -91,7 +91,7 @@ public class CoxOverlay extends Overlay
|
||||
if (boss != null)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = boss.getTransformedComposition();
|
||||
NPCDefinition composition = boss.getTransformedDefinition();
|
||||
{
|
||||
size = composition.getSize();
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class CoxOverlay extends Overlay
|
||||
if (baby != null)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition compositionbaby = baby.getTransformedComposition();
|
||||
NPCDefinition compositionbaby = baby.getTransformedDefinition();
|
||||
{
|
||||
size = compositionbaby.getSize();
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class CoxOverlay extends Overlay
|
||||
if (G1 != null)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = G1.getTransformedComposition();
|
||||
NPCDefinition composition = G1.getTransformedDefinition();
|
||||
{
|
||||
size = composition.getSize();
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class CoxOverlay extends Overlay
|
||||
if (G2 != null)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = G2.getTransformedComposition();
|
||||
NPCDefinition composition = G2.getTransformedDefinition();
|
||||
{
|
||||
size = composition.getSize();
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public class CoxOverlay extends Overlay
|
||||
if (boss != null)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = boss.getTransformedComposition();
|
||||
NPCDefinition composition = boss.getTransformedDefinition();
|
||||
{
|
||||
size = composition.getSize();
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public class CoxOverlay extends Overlay
|
||||
private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color, int outlineWidth, int outlineAlpha, int fillAlpha)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = actor.getTransformedComposition();
|
||||
NPCDefinition composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
|
||||
@@ -54,7 +54,7 @@ import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
@@ -396,12 +396,12 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged graphicChanged)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
Actor actor = graphicChanged.getActor();
|
||||
if (actor.getGraphic() == GraphicID.OLM_BURN)
|
||||
if (actor.getSpotAnimation() == GraphicID.OLM_BURN)
|
||||
{
|
||||
burnTarget.add(actor);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
package net.runelite.client.plugins.dailytaskindicators;
|
||||
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
@@ -36,7 +37,6 @@ import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
|
||||
@@ -31,7 +31,7 @@ import lombok.Setter;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.HeadIcon;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
|
||||
public class DemonicGorilla
|
||||
@@ -130,7 +130,7 @@ public class DemonicGorilla
|
||||
|
||||
public HeadIcon getOverheadIcon()
|
||||
{
|
||||
NPCComposition composition = this.npc.getComposition();
|
||||
NPCDefinition composition = this.npc.getDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
return composition.getOverheadIcon();
|
||||
|
||||
@@ -48,7 +48,7 @@ import net.runelite.api.GroundObject;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemLayer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
@@ -163,12 +163,12 @@ class DevToolsOverlay extends Overlay
|
||||
{
|
||||
if (p != local)
|
||||
{
|
||||
String text = p.getName() + " (A: " + p.getAnimation() + ") (G: " + p.getGraphic() + ")";
|
||||
String text = p.getName() + " (A: " + p.getAnimation() + ") (G: " + p.getSpotAnimation() + ")";
|
||||
OverlayUtil.renderActorOverlay(graphics, p, text, BLUE);
|
||||
}
|
||||
}
|
||||
|
||||
String text = local.getName() + " (A: " + local.getAnimation() + ") (G: " + local.getGraphic() + ")";
|
||||
String text = local.getName() + " (A: " + local.getAnimation() + ") (G: " + local.getSpotAnimation() + ")";
|
||||
OverlayUtil.renderActorOverlay(graphics, local, text, CYAN);
|
||||
renderPlayerWireframe(graphics, local, CYAN);
|
||||
}
|
||||
@@ -178,11 +178,11 @@ class DevToolsOverlay extends Overlay
|
||||
List<NPC> npcs = client.getNpcs();
|
||||
for (NPC npc : npcs)
|
||||
{
|
||||
NPCComposition composition = npc.getComposition();
|
||||
NPCDefinition composition = npc.getDefinition();
|
||||
Color color = composition.getCombatLevel() > 1 ? YELLOW : ORANGE;
|
||||
if (composition.getConfigs() != null)
|
||||
{
|
||||
NPCComposition transformedComposition = composition.transform();
|
||||
NPCDefinition transformedComposition = composition.transform();
|
||||
if (transformedComposition == null)
|
||||
{
|
||||
color = GRAY;
|
||||
@@ -197,7 +197,7 @@ class DevToolsOverlay extends Overlay
|
||||
composition.getName(),
|
||||
composition.getId(),
|
||||
npc.getAnimation(),
|
||||
npc.getGraphic());
|
||||
npc.getSpotAnimation());
|
||||
|
||||
OverlayUtil.renderActorOverlay(graphics, npc, text, color);
|
||||
}
|
||||
|
||||
@@ -320,15 +320,15 @@ public class DevToolsPlugin extends Plugin
|
||||
{
|
||||
int id = Integer.parseInt(args[0]);
|
||||
Player localPlayer = client.getLocalPlayer();
|
||||
localPlayer.setGraphic(id);
|
||||
localPlayer.setSpotAnimFrame(0);
|
||||
localPlayer.setSpotAnimation(id);
|
||||
localPlayer.setSpotAnimationFrame(0);
|
||||
break;
|
||||
}
|
||||
case "transform":
|
||||
{
|
||||
int id = Integer.parseInt(args[0]);
|
||||
Player player = client.getLocalPlayer();
|
||||
player.getPlayerComposition().setTransformedNpcId(id);
|
||||
player.getPlayerAppearance().setTransformedNpcId(id);
|
||||
player.setIdlePoseAnimation(-1);
|
||||
player.setPoseAnimation(-1);
|
||||
break;
|
||||
@@ -337,8 +337,8 @@ public class DevToolsPlugin extends Plugin
|
||||
{
|
||||
int id = Integer.parseInt(args[0]);
|
||||
Player player = client.getLocalPlayer();
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.CAPE.getIndex()] = id + 512;
|
||||
player.getPlayerComposition().setHash();
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = id + 512;
|
||||
player.getPlayerAppearance().setHash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import javax.swing.SwingUtilities;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.client.game.AsyncBufferedImage;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -95,7 +95,7 @@ public class EquipmentInspectorPanel extends PluginPanel
|
||||
update(new HashMap<>(), "");
|
||||
}
|
||||
|
||||
public void update(Map<KitType, ItemComposition> playerEquipment, String playerName)
|
||||
public void update(Map<KitType, ItemDefinition> playerEquipment, String playerName)
|
||||
{
|
||||
if (playerName.isEmpty())
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ import javax.swing.SwingUtilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.PlayerMenuOptionClicked;
|
||||
import net.runelite.api.kit.KitType;
|
||||
@@ -179,7 +179,7 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
Prot3 = 0;
|
||||
Prot4 = 0;
|
||||
Player p = targetPlayer.get();
|
||||
Map<KitType, ItemComposition> playerEquipment = new HashMap<>();
|
||||
Map<KitType, ItemDefinition> playerEquipment = new HashMap<>();
|
||||
|
||||
for (KitType kitType : KitType.values())
|
||||
{
|
||||
@@ -192,10 +192,10 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
continue;
|
||||
}
|
||||
|
||||
int itemId = p.getPlayerComposition().getEquipmentId(kitType);
|
||||
int itemId = p.getPlayerAppearance().getEquipmentId(kitType);
|
||||
if (itemId != -1)
|
||||
{
|
||||
ItemComposition itemComposition = client.getItemDefinition(itemId);
|
||||
ItemDefinition itemComposition = client.getItemDefinition(itemId);
|
||||
playerEquipment.put(kitType, itemComposition);
|
||||
int ItemPrice = itemManager.getItemPrice(itemId);
|
||||
TotalPrice += ItemPrice;
|
||||
|
||||
@@ -28,7 +28,7 @@ import javax.swing.GroupLayout;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.client.game.AsyncBufferedImage;
|
||||
import net.runelite.client.ui.ColorScheme;
|
||||
@@ -37,7 +37,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
class ItemPanel extends JPanel
|
||||
{
|
||||
ItemPanel(ItemComposition item, KitType kitType, AsyncBufferedImage icon)
|
||||
ItemPanel(ItemDefinition item, KitType kitType, AsyncBufferedImage icon)
|
||||
{
|
||||
|
||||
setBorder(new EmptyBorder(3, 3, 3, 3));
|
||||
|
||||
@@ -36,7 +36,7 @@ import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
@@ -199,12 +199,12 @@ public class ExaminePlugin extends Plugin
|
||||
log.debug("Got examine for {} {}: {}", pendingExamine.getType(), pendingExamine.getId(), event.getMessage());
|
||||
|
||||
// If it is an item, show the price of it
|
||||
final ItemComposition itemComposition;
|
||||
final ItemDefinition itemComposition;
|
||||
if (pendingExamine.getType() == ExamineType.ITEM || pendingExamine.getType() == ExamineType.ITEM_BANK_EQ)
|
||||
{
|
||||
final int itemId = pendingExamine.getId();
|
||||
final int itemQuantity = pendingExamine.getQuantity();
|
||||
itemComposition = itemManager.getItemComposition(itemId);
|
||||
itemComposition = itemManager.getItemDefinition(itemId);
|
||||
|
||||
if (itemComposition != null)
|
||||
{
|
||||
@@ -316,7 +316,7 @@ public class ExaminePlugin extends Plugin
|
||||
return null;
|
||||
}
|
||||
|
||||
private void getItemPrice(int id, ItemComposition itemComposition, int quantity)
|
||||
private void getItemPrice(int id, ItemDefinition itemComposition, int quantity)
|
||||
{
|
||||
// quantity is at least 1
|
||||
quantity = Math.max(1, quantity);
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
|
||||
class NPCContainer
|
||||
{
|
||||
@@ -67,7 +67,7 @@ class NPCContainer
|
||||
this.npcInteracting = npc.getInteracting();
|
||||
this.npcSpeed = 0;
|
||||
this.TicksUntilAttack = 0;
|
||||
final NPCComposition composition = npc.getTransformedComposition();
|
||||
final NPCDefinition composition = npc.getTransformedDefinition();
|
||||
|
||||
if (composition != null)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.awt.Polygon;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -148,7 +148,7 @@ public class TimersOverlay extends Overlay
|
||||
private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color, int outlineAlpha, int fillAlpha)
|
||||
{
|
||||
int size = 1;
|
||||
NPCComposition composition = actor.getTransformedComposition();
|
||||
NPCDefinition composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
|
||||
@@ -76,7 +76,7 @@ class FishingSpotMinimapOverlay extends Overlay
|
||||
continue;
|
||||
}
|
||||
|
||||
Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
|
||||
Color color = npc.getSpotAnimation() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
|
||||
|
||||
net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
|
||||
if (minimapLocation != null)
|
||||
|
||||
@@ -95,7 +95,7 @@ class FishingSpotOverlay extends Overlay
|
||||
continue;
|
||||
}
|
||||
|
||||
Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
|
||||
Color color = npc.getSpotAnimation() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
|
||||
|
||||
if (spot == FishingSpot.MINNOW && config.showMinnowOverlay())
|
||||
{
|
||||
|
||||
@@ -219,7 +219,7 @@ public class FreezeTimersOverlay extends Overlay
|
||||
{
|
||||
renderActorText(g, actor, text, overlaysDrawn, VENG_IMAGE);
|
||||
}
|
||||
if (actor.getGraphic() == GraphicID.VENGEANCE || actor.getGraphic() == GraphicID.VENGEANCE_OTHER)
|
||||
if (actor.getSpotAnimation() == GraphicID.VENGEANCE || actor.getSpotAnimation() == GraphicID.VENGEANCE_OTHER)
|
||||
{
|
||||
|
||||
g.setColor(RED);
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
@@ -86,10 +86,10 @@ public class FreezeTimersPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged graphicChanged)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
int oldGraphic = prayerTracker.getSpotanimLastTick(graphicChanged.getActor());
|
||||
int newGraphic = graphicChanged.getActor().getGraphic();
|
||||
int newGraphic = graphicChanged.getActor().getSpotAnimation();
|
||||
if (oldGraphic == newGraphic)
|
||||
{
|
||||
return;
|
||||
@@ -119,9 +119,9 @@ public class FreezeTimersPlugin extends Plugin
|
||||
prayerTracker.gameTick();
|
||||
for (Actor actor : client.getPlayers())
|
||||
{
|
||||
if (prayerTracker.getSpotanimLastTick(actor) != actor.getGraphic())
|
||||
if (prayerTracker.getSpotanimLastTick(actor) != actor.getSpotAnimation())
|
||||
{
|
||||
GraphicChanged callback = new GraphicChanged();
|
||||
SpotAnimationChanged callback = new SpotAnimationChanged();
|
||||
callback.setActor(actor);
|
||||
client.getCallbacks().post(callback);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PrayerTracker
|
||||
{
|
||||
newTick.get(actor).put("PrayerIcon", ((Player) actor).getOverheadIcon() == null ? -1 : ((Player) actor).getOverheadIcon().ordinal());
|
||||
}
|
||||
newTick.get(actor).put("SpotAnim", actor.getGraphic());
|
||||
newTick.get(actor).put("SpotAnim", actor.getSpotAnimation());
|
||||
}
|
||||
|
||||
public int getPrayerIconLastTick(Actor p)
|
||||
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.GrandExchangeOfferState;
|
||||
import static net.runelite.api.GrandExchangeOfferState.CANCELLED_BUY;
|
||||
import static net.runelite.api.GrandExchangeOfferState.CANCELLED_SELL;
|
||||
import static net.runelite.api.GrandExchangeOfferState.EMPTY;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.client.ui.ColorScheme;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.components.ThinProgressBar;
|
||||
@@ -193,7 +193,7 @@ public class GrandExchangeOfferSlot extends JPanel
|
||||
add(progressBar, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
void updateOffer(ItemComposition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
|
||||
void updateOffer(ItemDefinition offerItem, BufferedImage itemImage, @Nullable GrandExchangeOffer newOffer)
|
||||
{
|
||||
if (newOffer == null || newOffer.getState() == EMPTY)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import net.runelite.api.GrandExchangeOffer;
|
||||
import net.runelite.api.GrandExchangeOfferState;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.client.ui.ColorScheme;
|
||||
import net.runelite.client.ui.components.PluginErrorPanel;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class GrandExchangeOffersPanel extends JPanel
|
||||
updateEmptyOffersPanel();
|
||||
}
|
||||
|
||||
void updateOffer(ItemComposition item, BufferedImage itemImage, GrandExchangeOffer newOffer, int slot)
|
||||
void updateOffer(ItemDefinition item, BufferedImage itemImage, GrandExchangeOffer newOffer, int slot)
|
||||
{
|
||||
/* If slot was previously filled, and is now empty, remove it from the list */
|
||||
if (newOffer == null || newOffer.getState() == GrandExchangeOfferState.EMPTY)
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.GrandExchangeOffer;
|
||||
import net.runelite.api.GrandExchangeOfferState;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
@@ -269,7 +269,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
final int slot = offerEvent.getSlot();
|
||||
final GrandExchangeOffer offer = offerEvent.getOffer();
|
||||
|
||||
ItemComposition offerItem = itemManager.getItemComposition(offer.getItemId());
|
||||
ItemDefinition offerItem = itemManager.getItemDefinition(offer.getItemId());
|
||||
boolean shouldStack = offerItem.isStackable() || offer.getTotalQuantity() > 1;
|
||||
BufferedImage itemImage = itemManager.getImage(offer.getItemId(), offer.getTotalQuantity(), shouldStack);
|
||||
SwingUtilities.invokeLater(() -> panel.getOffersPanel().updateOffer(offerItem, itemImage, offer, slot));
|
||||
|
||||
@@ -42,7 +42,7 @@ import javax.swing.SwingUtilities;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.game.AsyncBufferedImage;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -200,7 +200,7 @@ class GrandExchangeSearchPanel extends JPanel
|
||||
|
||||
int itemId = item.getId();
|
||||
|
||||
ItemComposition itemComp = itemManager.getItemComposition(itemId);
|
||||
ItemDefinition itemComp = itemManager.getItemDefinition(itemId);
|
||||
if (itemComp == null)
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -51,7 +51,7 @@ import lombok.Setter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.ItemLayer;
|
||||
import net.runelite.api.MenuAction;
|
||||
@@ -316,10 +316,10 @@ public class GroundItemsPlugin extends Plugin
|
||||
|
||||
private void lootNotifier(Collection<ItemStack> items)
|
||||
{
|
||||
ItemComposition composition;
|
||||
ItemDefinition composition;
|
||||
for (ItemStack is : items)
|
||||
{
|
||||
composition = itemManager.getItemComposition(is.getId());
|
||||
composition = itemManager.getItemDefinition(is.getId());
|
||||
Color itemColor = getHighlighted(composition.getName(), itemManager.getItemPrice(is.getId()) * is.getQuantity(), itemManager.getAlchValue(is.getId()) * is.getQuantity());
|
||||
if (itemColor != null)
|
||||
{
|
||||
@@ -479,7 +479,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
{
|
||||
// Collect the data for the item
|
||||
final int itemId = item.getId();
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId;
|
||||
final int alchPrice = itemManager.getAlchValue(realItemId);
|
||||
int durationMillis;
|
||||
@@ -608,7 +608,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
current = current.getNext();
|
||||
}
|
||||
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemComposition.getId();
|
||||
final int itemPrice = itemManager.getItemPrice(realItemId);
|
||||
final int price = itemPrice <= 0 ? itemComposition.getPrice() : itemPrice;
|
||||
@@ -755,7 +755,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
|
||||
private int getGePriceFromItemId(int itemId)
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId;
|
||||
|
||||
return itemManager.getItemPrice(realItemId);
|
||||
@@ -763,7 +763,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
|
||||
private boolean isItemIdHidden(int itemId)
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId;
|
||||
final int alchPrice = itemManager.getAlchValue(realItemId);
|
||||
final int gePrice = itemManager.getItemPrice(realItemId);
|
||||
@@ -773,7 +773,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
|
||||
private int getCollapsedItemQuantity(int itemId, String item)
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final boolean itemNameIncludesQuantity = Pattern.compile("\\(\\d+\\)").matcher(itemComposition.getName()).find();
|
||||
|
||||
Matcher matcher = Pattern.compile("\\((\\d+)\\)").matcher(item);
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
||||
@@ -119,7 +119,7 @@ public class HighAlchemyOverlay extends WidgetItemOverlay
|
||||
private int getNotedId(int id)
|
||||
{
|
||||
int noteID = id;
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(noteID);
|
||||
ItemDefinition itemComposition = itemManager.getItemDefinition(noteID);
|
||||
if (itemComposition.getNote() != -1)
|
||||
{
|
||||
noteID = itemComposition.getLinkedNoteId();
|
||||
|
||||
@@ -128,7 +128,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.GraphicID;
|
||||
import net.runelite.api.Hitsplat;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.SkullIcon;
|
||||
@@ -138,7 +138,7 @@ import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.events.InteractingChanged;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
@@ -213,7 +213,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
int graphic = localPlayer.getGraphic();
|
||||
int graphic = localPlayer.getSpotAnimation();
|
||||
int animation = localPlayer.getAnimation();
|
||||
switch (animation)
|
||||
{
|
||||
@@ -390,7 +390,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
|
||||
final NPC npc = (NPC) target;
|
||||
final NPCComposition npcComposition = npc.getComposition();
|
||||
final NPCDefinition npcComposition = npc.getDefinition();
|
||||
final List<String> npcMenuActions = Arrays.asList(npcComposition.getActions());
|
||||
|
||||
if (npcMenuActions.contains("Attack"))
|
||||
@@ -462,7 +462,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged event)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
|
||||
@@ -471,7 +471,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (actor.getGraphic() == GraphicID.SPLASH)
|
||||
if (actor.getSpotAnimation() == GraphicID.SPLASH)
|
||||
{
|
||||
lastCombatCountdown = HIGHEST_MONSTER_ATTACK_SPEED;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -115,12 +115,12 @@ public class ImplingsOverlay extends Overlay
|
||||
List<NPC> npcs = client.getNpcs();
|
||||
for (NPC npc : npcs)
|
||||
{
|
||||
if (npc.getComposition().getId() == spawnID)
|
||||
if (npc.getDefinition().getId() == spawnID)
|
||||
{
|
||||
NPCComposition composition = npc.getComposition();
|
||||
NPCDefinition composition = npc.getDefinition();
|
||||
if (composition.getConfigs() != null)
|
||||
{
|
||||
NPCComposition transformedComposition = composition.transform();
|
||||
NPCDefinition transformedComposition = composition.transform();
|
||||
if (transformedComposition == null)
|
||||
{
|
||||
OverlayUtil.renderActorOverlay(graphics, npc, text, color);
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Player;
|
||||
import static net.runelite.api.SpriteID.WINDOW_CLOSE_BUTTON_RED_X;
|
||||
import static net.runelite.api.SpriteID.WINDOW_CLOSE_BUTTON_RED_X_HOVERED;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -168,7 +168,7 @@ class InstanceMapOverlay extends Overlay
|
||||
{
|
||||
BufferedImage closeButton = getCloseButtonImage();
|
||||
|
||||
SpritePixels map = client.drawInstanceMap(viewedPlane);
|
||||
Sprite map = client.drawInstanceMap(viewedPlane);
|
||||
image = minimapToBufferedImage(map);
|
||||
synchronized (this)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ class InstanceMapOverlay extends Overlay
|
||||
mapImage = null;
|
||||
}
|
||||
|
||||
private static BufferedImage minimapToBufferedImage(SpritePixels spritePixels)
|
||||
private static BufferedImage minimapToBufferedImage(Sprite spritePixels)
|
||||
{
|
||||
int width = spritePixels.getWidth();
|
||||
int height = spritePixels.getHeight();
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.api.HealthBar;
|
||||
import net.runelite.api.HealthBarOverride;
|
||||
import net.runelite.api.NodeCache;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
import net.runelite.api.events.BeforeMenuRender;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.PostHealthBar;
|
||||
@@ -123,7 +123,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
}
|
||||
|
||||
HealthBar healthBar = postHealthBar.getHealthBar();
|
||||
SpritePixels frontSprite = healthBar.getHealthBarFrontSprite();
|
||||
Sprite frontSprite = healthBar.getHealthBarFrontSprite();
|
||||
|
||||
// Check if this is the health bar we are replacing
|
||||
if (frontSprite == healthBarOverride.getFrontSprite() || frontSprite == healthBarOverride.getFrontSpriteLarge())
|
||||
@@ -162,7 +162,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
if (skin == config.skin())
|
||||
{
|
||||
String file = config.skin().toString() + "/" + spriteOverride.getSpriteID() + ".png";
|
||||
SpritePixels spritePixels = getFileSpritePixels(file);
|
||||
Sprite spritePixels = getFileSprite(file);
|
||||
|
||||
if (spriteOverride.getSpriteID() == SpriteID.COMPASS_TEXTURE)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
if (widgetOverride.getSkin() == config.skin())
|
||||
{
|
||||
String file = config.skin().toString() + "/widget/" + widgetOverride.getName() + ".png";
|
||||
SpritePixels spritePixels = getFileSpritePixels(file);
|
||||
Sprite spritePixels = getFileSprite(file);
|
||||
|
||||
if (spritePixels != null)
|
||||
{
|
||||
@@ -218,13 +218,13 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private SpritePixels getFileSpritePixels(String file)
|
||||
private Sprite getFileSprite(String file)
|
||||
{
|
||||
try
|
||||
{
|
||||
log.debug("Loading: {}", file);
|
||||
BufferedImage image = ImageUtil.getResourceStreamFromClass(this.getClass(), file);
|
||||
return ImageUtil.getImageSpritePixels(image, client);
|
||||
return ImageUtil.getImageSprite(image, client);
|
||||
}
|
||||
catch (RuntimeException ex)
|
||||
{
|
||||
@@ -280,11 +280,11 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
{
|
||||
String fileBase = Skin.AROUND_2010.toString() + "/healthbar/";
|
||||
|
||||
SpritePixels frontSprite = getFileSpritePixels(fileBase + "front.png");
|
||||
SpritePixels backSprite = getFileSpritePixels(fileBase + "back.png");
|
||||
Sprite frontSprite = getFileSprite(fileBase + "front.png");
|
||||
Sprite backSprite = getFileSprite(fileBase + "back.png");
|
||||
|
||||
SpritePixels frontSpriteLarge = getFileSpritePixels(fileBase + "front_large.png");
|
||||
SpritePixels backSpriteLarge = getFileSpritePixels(fileBase + "back_large.png");
|
||||
Sprite frontSpriteLarge = getFileSprite(fileBase + "front_large.png");
|
||||
Sprite backSpriteLarge = getFileSprite(fileBase + "back_large.png");
|
||||
|
||||
HealthBarOverride override = new HealthBarOverride(frontSprite, backSprite, frontSpriteLarge, backSpriteLarge);
|
||||
healthBarOverride = override;
|
||||
@@ -319,7 +319,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
|
||||
if (compassImage != null)
|
||||
{
|
||||
SpritePixels compass = ImageUtil.getImageSpritePixels(compassImage, client);
|
||||
Sprite compass = ImageUtil.getImageSprite(compassImage, client);
|
||||
client.setCompass(compass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -375,7 +375,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
String itemName = "";
|
||||
if (client.isClientThread())
|
||||
{
|
||||
itemName = itemManager.getItemComposition(item.getId()).getName();
|
||||
itemName = itemManager.getItemDefinition(item.getId()).getName();
|
||||
}
|
||||
newContainer.add(new InventorySetupItem(item.getId(), itemName, item.getQuantity()));
|
||||
}
|
||||
@@ -415,7 +415,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
for (InventorySetupItem item : items)
|
||||
{
|
||||
int id = item.getId();
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(id);
|
||||
ItemDefinition itemComposition = itemManager.getItemDefinition(id);
|
||||
if (id > 0)
|
||||
{
|
||||
itemIds.add(ItemVariationMapping.map(id));
|
||||
|
||||
@@ -36,7 +36,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -186,7 +186,7 @@ class InventoryViewerOverlay extends Overlay
|
||||
|
||||
private BufferedImage getImage(Item item)
|
||||
{
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(item.getId());
|
||||
ItemDefinition itemComposition = itemManager.getItemDefinition(item.getId());
|
||||
return itemManager.getImage(item.getId(), item.getQuantity(), itemComposition.isStackable());
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
@@ -500,11 +500,11 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged event)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
{
|
||||
if (event.getActor() == client.getLocalPlayer())
|
||||
{
|
||||
if (client.getLocalPlayer().getGraphic() == GraphicID.XERIC_TELEPORT)
|
||||
if (client.getLocalPlayer().getSpotAnimation() == GraphicID.XERIC_TELEPORT)
|
||||
{
|
||||
final int xericCharges = Math.max(config.xericTalisman() - 1, 0);
|
||||
updateXericCharges(xericCharges);
|
||||
@@ -723,7 +723,7 @@ public class ItemChargePlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final String name = itemManager.getItemComposition(id).getName();
|
||||
final String name = itemManager.getItemDefinition(id).getName();
|
||||
final BufferedImage image = itemManager.getImage(id);
|
||||
final ItemChargeInfobox infobox = new ItemChargeInfobox(this, image, name, charges, type, slot);
|
||||
infoBoxManager.addInfoBox(infobox);
|
||||
|
||||
@@ -31,7 +31,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuAction;
|
||||
@@ -178,11 +178,11 @@ class ItemPricesOverlay extends Overlay
|
||||
return StackFormatter.formatNumber(qty * 1000) + " gp";
|
||||
}
|
||||
|
||||
ItemComposition itemDef = itemManager.getItemComposition(id);
|
||||
ItemDefinition itemDef = itemManager.getItemDefinition(id);
|
||||
if (itemDef.getNote() != -1)
|
||||
{
|
||||
id = itemDef.getLinkedNoteId();
|
||||
itemDef = itemManager.getItemComposition(id);
|
||||
itemDef = itemManager.getItemDefinition(id);
|
||||
}
|
||||
|
||||
// Only check prices for things with store prices
|
||||
|
||||
@@ -239,7 +239,7 @@ public class ItemStatPlugin extends Plugin
|
||||
icon.setBorderType(1);
|
||||
icon.revalidate();
|
||||
|
||||
Widget itemName = createText(invContainer, itemManager.getItemComposition(id).getName(), FontID.PLAIN_12, ORANGE_TEXT,
|
||||
Widget itemName = createText(invContainer, itemManager.getItemDefinition(id).getName(), FontID.PLAIN_12, ORANGE_TEXT,
|
||||
50, yPos, invContainer.getWidth() - 40, 30);
|
||||
itemName.setYTextAlignment(WidgetTextAlignment.CENTER);
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ import static net.runelite.api.ItemID._23_CHOCOLATE_CAKE;
|
||||
|
||||
/**
|
||||
* Certain items aren't tradeable via the GE but can be traded between players.
|
||||
* The {@link net.runelite.api.ItemComposition}'s `isTradeable` value is based on GE trade-ability so we need
|
||||
* The {@link net.runelite.api.ItemDefinition}'s `isTradeable` value is based on GE trade-ability so we need
|
||||
* to account for these items. These items should only be kept if protected based on item value.
|
||||
*/
|
||||
public enum ActuallyTradeableItem
|
||||
|
||||
@@ -208,8 +208,8 @@ public class KeptOnDeathPlugin extends Plugin
|
||||
{
|
||||
int o1ID = ItemVariationMapping.map(itemManager.canonicalize(o1.getId()));
|
||||
int o2ID = ItemVariationMapping.map(itemManager.canonicalize(o2.getId()));
|
||||
ItemComposition c1 = itemManager.getItemComposition(o1ID);
|
||||
ItemComposition c2 = itemManager.getItemComposition(o2ID);
|
||||
ItemDefinition c1 = itemManager.getItemDefinition(o1ID);
|
||||
ItemDefinition c2 = itemManager.getItemDefinition(o2ID);
|
||||
int exchangePrice1 = c1.isTradeable() ? itemManager.getItemPrice(c1.getId()) : c1.getPrice();
|
||||
int exchangePrice2 = c2.isTradeable() ? itemManager.getItemPrice(c2.getId()) : c2.getPrice();
|
||||
return exchangePrice2 - exchangePrice1;
|
||||
@@ -227,7 +227,7 @@ public class KeptOnDeathPlugin extends Plugin
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemComposition c = itemManager.getItemComposition(i.getId());
|
||||
ItemDefinition c = itemManager.getItemDefinition(i.getId());
|
||||
Widget itemWidget = createItemWidget(i.getQuantity(), c);
|
||||
|
||||
// Bonds are always kept and do not count towards the limit.
|
||||
@@ -425,7 +425,7 @@ public class KeptOnDeathPlugin extends Plugin
|
||||
if (price == 0)
|
||||
{
|
||||
// Default to alch price
|
||||
price = itemManager.getItemComposition(w.getItemId()).getPrice() * HIGH_ALCH;
|
||||
price = itemManager.getItemDefinition(w.getItemId()).getPrice() * HIGH_ALCH;
|
||||
}
|
||||
total += price;
|
||||
}
|
||||
@@ -439,12 +439,12 @@ public class KeptOnDeathPlugin extends Plugin
|
||||
}
|
||||
|
||||
// isTradeable checks if they are traded on the grand exchange, some items are trade-able but not via GE
|
||||
private boolean checkTradeable(int id, ItemComposition c)
|
||||
private boolean checkTradeable(int id, ItemDefinition c)
|
||||
{
|
||||
// If the item is a note check the unnoted variants trade ability
|
||||
if (c.getNote() != -1)
|
||||
{
|
||||
return checkTradeable(c.getLinkedNoteId(), itemManager.getItemComposition(c.getLinkedNoteId()));
|
||||
return checkTradeable(c.getLinkedNoteId(), itemManager.getItemDefinition(c.getLinkedNoteId()));
|
||||
}
|
||||
|
||||
switch (id)
|
||||
@@ -572,7 +572,7 @@ public class KeptOnDeathPlugin extends Plugin
|
||||
* @return
|
||||
*//*
|
||||
|
||||
private Widget createItemWidget(int qty, ItemComposition c)
|
||||
private Widget createItemWidget(int qty, ItemDefinition c)
|
||||
{
|
||||
Widget itemWidget = client.createWidget();
|
||||
itemWidget.setType(WidgetType.GRAPHIC);
|
||||
|
||||
@@ -64,7 +64,7 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
@@ -735,7 +735,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private LootTrackerItem buildLootTrackerItem(int itemId, int quantity)
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId;
|
||||
final long price = (long) itemManager.getItemPrice(realItemId) * (long) quantity;
|
||||
final boolean ignored = ignoredItems.contains(itemComposition.getName());
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.MenuAction;
|
||||
import static net.runelite.api.MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET;
|
||||
import static net.runelite.api.MenuAction.WALK;
|
||||
@@ -60,7 +60,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOpened;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.PostItemComposition;
|
||||
import net.runelite.api.events.PostItemDefinition;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -238,14 +238,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
else if (event.getKey().startsWith(ITEM_KEY_PREFIX))
|
||||
{
|
||||
clientThread.invoke(this::resetItemCompositionCache);
|
||||
clientThread.invoke(this::resetItemDefinitionCache);
|
||||
}
|
||||
}
|
||||
|
||||
private void resetItemCompositionCache()
|
||||
private void resetItemDefinitionCache()
|
||||
{
|
||||
itemManager.invalidateItemCompositionCache();
|
||||
client.getItemCompositionCache().reset();
|
||||
itemManager.invalidateItemDefinitionCache();
|
||||
client.getItemDefinitionCache().reset();
|
||||
}
|
||||
|
||||
private Integer getSwapConfig(int itemId)
|
||||
@@ -276,7 +276,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
{
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
refreshShiftClickCustomizationMenus();
|
||||
clientThread.invoke(this::resetItemCompositionCache);
|
||||
clientThread.invoke(this::resetItemDefinitionCache);
|
||||
}
|
||||
|
||||
private void disableCustomization()
|
||||
@@ -284,7 +284,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
removeShiftClickCustomizationMenus();
|
||||
configuringShiftClick = false;
|
||||
clientThread.invoke(this::resetItemCompositionCache);
|
||||
clientThread.invoke(this::resetItemDefinitionCache);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -456,7 +456,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
ItemComposition itemComposition = client.getItemDefinition(itemId);
|
||||
ItemDefinition itemComposition = client.getItemDefinition(itemId);
|
||||
String itemName = itemComposition.getName();
|
||||
String option = "Use";
|
||||
int shiftClickActionindex = itemComposition.getShiftClickActionIndex();
|
||||
@@ -508,7 +508,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
String option = event.getMenuOption();
|
||||
String target = event.getMenuTarget();
|
||||
ItemComposition itemComposition = client.getItemDefinition(itemId);
|
||||
ItemDefinition itemComposition = client.getItemDefinition(itemId);
|
||||
|
||||
if (option.equals(RESET) && target.equals(MENU_TARGET))
|
||||
{
|
||||
@@ -1267,9 +1267,9 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPostItemComposition(PostItemComposition event)
|
||||
public void onPostItemDefinition(PostItemDefinition event)
|
||||
{
|
||||
ItemComposition itemComposition = event.getItemComposition();
|
||||
ItemDefinition itemComposition = event.getItemDefinition();
|
||||
Integer option = getSwapConfig(itemComposition.getId());
|
||||
|
||||
if (option != null)
|
||||
|
||||
@@ -26,7 +26,7 @@ package net.runelite.client.plugins.minimap;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
|
||||
public class MinimapDot
|
||||
{
|
||||
@@ -67,10 +67,10 @@ public class MinimapDot
|
||||
return pixels;
|
||||
}
|
||||
|
||||
public static SpritePixels create(Client client, Color color)
|
||||
public static Sprite create(Client client, Color color)
|
||||
{
|
||||
int[] pixels = createPixels(color);
|
||||
|
||||
return client.createSpritePixels(pixels, MAP_DOT_WIDTH, MAP_DOT_HEIGHT);
|
||||
return client.createSprite(pixels, MAP_DOT_WIDTH, MAP_DOT_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.Arrays;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
@@ -56,7 +56,7 @@ public class MinimapPlugin extends Plugin
|
||||
@Inject
|
||||
private MinimapConfig config;
|
||||
|
||||
private SpritePixels[] originalDotSprites;
|
||||
private Sprite[] originalDotSprites;
|
||||
|
||||
@Provides
|
||||
private MinimapConfig provideConfig(ConfigManager configManager)
|
||||
@@ -138,7 +138,7 @@ public class MinimapPlugin extends Plugin
|
||||
|
||||
private void replaceMapDots()
|
||||
{
|
||||
SpritePixels[] mapDots = client.getMapDots();
|
||||
Sprite[] mapDots = client.getMapDots();
|
||||
|
||||
if (mapDots == null)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ public class MinimapPlugin extends Plugin
|
||||
|
||||
private void storeOriginalDots()
|
||||
{
|
||||
SpritePixels[] originalDots = client.getMapDots();
|
||||
Sprite[] originalDots = client.getMapDots();
|
||||
|
||||
if (originalDots == null)
|
||||
{
|
||||
@@ -178,7 +178,7 @@ public class MinimapPlugin extends Plugin
|
||||
|
||||
private void restoreOriginalDots()
|
||||
{
|
||||
SpritePixels[] mapDots = client.getMapDots();
|
||||
Sprite[] mapDots = client.getMapDots();
|
||||
|
||||
if (originalDotSprites == null || mapDots == null)
|
||||
{
|
||||
|
||||
@@ -30,11 +30,12 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
|
||||
@@ -31,11 +31,11 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.WallObject;
|
||||
@@ -152,7 +152,7 @@ public class MultiIndicatorsPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectComposition objectComposition = client.getObjectDefinition(wallObject.getId());
|
||||
ObjectDefinition objectComposition = client.getObjectDefinition(wallObject.getId());
|
||||
if (objectComposition == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.EnumComposition;
|
||||
import net.runelite.api.EnumDefinition;
|
||||
import net.runelite.api.EnumID;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -153,7 +153,7 @@ public class MusicIndicatorPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final EnumComposition names = client.getEnum(EnumID.MUSIC_TRACK_NAMES);
|
||||
final EnumDefinition names = client.getEnum(EnumID.MUSIC_TRACK_NAMES);
|
||||
final int varpId = MUSIC_TRACK_VARPS.indexOf(varPlayer) + 1;
|
||||
|
||||
for (int bit = 0; bit < Integer.SIZE; ++bit)
|
||||
@@ -180,7 +180,7 @@ public class MusicIndicatorPlugin extends Plugin
|
||||
{
|
||||
// values are packed into a coordgrid
|
||||
int packed = (variableId << 14) | bit;
|
||||
EnumComposition ids = client.getEnum(EnumID.MUSIC_TRACK_IDS);
|
||||
EnumDefinition ids = client.getEnum(EnumID.MUSIC_TRACK_IDS);
|
||||
for (int key : ids.getKeys())
|
||||
{
|
||||
int value = ids.getIntValue(key);
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
class MemorizedNpc
|
||||
@@ -69,7 +69,7 @@ class MemorizedNpc
|
||||
this.respawnTime = -1;
|
||||
this.diedOnTick = -1;
|
||||
|
||||
final NPCComposition composition = npc.getTransformedComposition();
|
||||
final NPCDefinition composition = npc.getTransformedDefinition();
|
||||
|
||||
if (composition != null)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -160,7 +160,7 @@ public class NpcSceneOverlay extends Overlay
|
||||
|
||||
case TILE:
|
||||
int size = 1;
|
||||
NPCComposition composition = actor.getTransformedComposition();
|
||||
NPCDefinition composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.npcunaggroarea;
|
||||
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
@@ -36,7 +37,6 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.npcunaggroarea;
|
||||
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Provides;
|
||||
@@ -43,7 +44,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
@@ -52,7 +53,6 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.geometry.Geometry;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -257,7 +257,7 @@ public class NpcAggroAreaPlugin extends Plugin
|
||||
|
||||
private boolean isNpcMatch(NPC npc)
|
||||
{
|
||||
NPCComposition composition = npc.getTransformedComposition();
|
||||
NPCDefinition composition = npc.getTransformedDefinition();
|
||||
if (composition == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -48,7 +48,7 @@ import net.runelite.api.GameObject;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Scene;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.TileObject;
|
||||
@@ -234,7 +234,7 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
final TileObject object = findTileObject(tile, event.getIdentifier());
|
||||
if (object != null)
|
||||
{
|
||||
final ObjectComposition objectDefinition = client.getObjectDefinition(object.getId());
|
||||
final ObjectDefinition objectDefinition = client.getObjectDefinition(object.getId());
|
||||
final String name = objectDefinition.getName();
|
||||
|
||||
if (!Strings.isNullOrEmpty(name))
|
||||
@@ -291,7 +291,7 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectComposition objectDefinition = client.getObjectDefinition(object.getId());
|
||||
ObjectDefinition objectDefinition = client.getObjectDefinition(object.getId());
|
||||
String name = objectDefinition.getName();
|
||||
if (Strings.isNullOrEmpty(name))
|
||||
{
|
||||
@@ -353,7 +353,7 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
|
||||
// Check impostors
|
||||
final ObjectComposition comp = client.getObjectDefinition(object.getId());
|
||||
final ObjectDefinition comp = client.getObjectDefinition(object.getId());
|
||||
|
||||
if (comp.getImpostorIds() != null)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.ClanMemberRank;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.SkullIcon;
|
||||
@@ -183,15 +183,15 @@ public class PlayerIndicatorsOverlay extends Overlay
|
||||
color);
|
||||
|
||||
}
|
||||
if (config.targetRisk() && PvPUtil.isAttackable(client, actor) && actor.getPlayerComposition() != null)
|
||||
if (config.targetRisk() && PvPUtil.isAttackable(client, actor) && actor.getPlayerAppearance() != null)
|
||||
{
|
||||
long totalValue = 0;
|
||||
int newValue;
|
||||
StringBuilder stringBuilder = new StringBuilder(" ");
|
||||
for (KitType kitType : KitType.values())
|
||||
{
|
||||
ItemComposition itemComposition =
|
||||
itemManager.getItemComposition(actor.getPlayerComposition().getEquipmentId(kitType));
|
||||
ItemDefinition itemComposition =
|
||||
itemManager.getItemDefinition(actor.getPlayerAppearance().getEquipmentId(kitType));
|
||||
if (itemComposition != null && itemComposition.getName() != null)
|
||||
{
|
||||
totalValue = totalValue + itemComposition.getPrice();
|
||||
@@ -204,9 +204,9 @@ public class PlayerIndicatorsOverlay extends Overlay
|
||||
name = name + stringBuilder;
|
||||
}
|
||||
}
|
||||
if (config.unchargedGlory() && actor.getPlayerComposition() != null)
|
||||
if (config.unchargedGlory() && actor.getPlayerAppearance() != null)
|
||||
{
|
||||
ItemComposition itemComposition = itemManager.getItemComposition(actor.getPlayerComposition().getEquipmentId(KitType.AMULET));
|
||||
ItemDefinition itemComposition = itemManager.getItemDefinition(actor.getPlayerAppearance().getEquipmentId(KitType.AMULET));
|
||||
if (itemComposition != null && itemComposition.getId() == 1704) //1704 is uncharged glory, to be certain
|
||||
{
|
||||
name = name + " cGLORY";
|
||||
|
||||
@@ -339,7 +339,7 @@ public class PoisonPlugin extends Plugin
|
||||
{
|
||||
heart = newHeart;
|
||||
client.getWidgetSpriteCache().reset();
|
||||
client.getSpriteOverrides().put(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, ImageUtil.getImageSpritePixels(heart, client));
|
||||
client.getSpriteOverrides().put(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, ImageUtil.getImageSprite(heart, client));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.awt.image.BufferedImage;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.kit.KitType;
|
||||
@@ -210,8 +210,8 @@ class PrayAgainstPlayerOverlay extends Overlay
|
||||
{
|
||||
if (config.drawUnknownWeapons())
|
||||
{
|
||||
int itemId = player.getPlayerComposition().getEquipmentId(KitType.WEAPON);
|
||||
ItemComposition itemComposition = client.getItemDefinition(itemId);
|
||||
int itemId = player.getPlayerAppearance().getEquipmentId(KitType.WEAPON);
|
||||
ItemDefinition itemComposition = client.getItemDefinition(itemId);
|
||||
|
||||
final String str = itemComposition.getName().toUpperCase();
|
||||
Point point = player.getCanvasTextLocation(graphics, str, offset);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
package net.runelite.client.plugins.prayagainstplayer;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.kit.KitType;
|
||||
|
||||
@@ -46,8 +46,8 @@ enum WeaponType
|
||||
*/
|
||||
public static WeaponType checkWeaponOnPlayer(Client client, Player attacker)
|
||||
{
|
||||
int itemId = attacker.getPlayerComposition().getEquipmentId(KitType.WEAPON);
|
||||
ItemComposition itemComposition = client.getItemDefinition(itemId);
|
||||
int itemId = attacker.getPlayerAppearance().getEquipmentId(KitType.WEAPON);
|
||||
ItemDefinition itemComposition = client.getItemDefinition(itemId);
|
||||
String weaponNameGivenLowerCase = itemComposition.getName().toLowerCase();
|
||||
|
||||
if (itemId == -1)
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.SkullIcon;
|
||||
@@ -170,10 +170,10 @@ public class PvpToolsPlugin extends Plugin
|
||||
};
|
||||
|
||||
private final HotkeyListener renderselfHotkeyListener = new HotkeyListener(() -> config.renderSelf())
|
||||
{
|
||||
{ //TODO FIX
|
||||
public void hotkeyPressed()
|
||||
{
|
||||
client.toggleRenderSelf();
|
||||
//client.toggleRenderSelf();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -561,7 +561,7 @@ public class PvpToolsPlugin extends Plugin
|
||||
{
|
||||
int value = (itemManager.getItemPrice(i.getId()) * i.getQuantity());
|
||||
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(i.getId());
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(i.getId());
|
||||
if (!itemComposition.isTradeable() && value == 0)
|
||||
{
|
||||
value = itemComposition.getPrice() * i.getQuantity();
|
||||
@@ -610,7 +610,7 @@ public class PvpToolsPlugin extends Plugin
|
||||
{
|
||||
if (!descendingMap.isEmpty())
|
||||
{
|
||||
itemManager.getItemComposition(priceMap.descendingMap().pollFirstEntry().getValue().getId())
|
||||
itemManager.getItemDefinition(priceMap.descendingMap().pollFirstEntry().getValue().getId())
|
||||
.getName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.awt.geom.Area;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.TileObject;
|
||||
@@ -84,8 +84,8 @@ public class PyramidPlunderOverlay extends Overlay
|
||||
if (object.getId() == CLOSED_DOOR || object.getId() == OPENED_DOOR)
|
||||
{
|
||||
//Impostor
|
||||
ObjectComposition comp = client.getObjectDefinition(objectID);
|
||||
ObjectComposition impostor = comp.getImpostor();
|
||||
ObjectDefinition comp = client.getObjectDefinition(objectID);
|
||||
ObjectDefinition impostor = comp.getImpostor();
|
||||
|
||||
if (impostor == null)
|
||||
{
|
||||
|
||||
@@ -152,34 +152,24 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
return configManager.getConfig(RuneLitePlusConfig.class);
|
||||
}
|
||||
|
||||
private RuneLitePlusKeyListener keyListener;
|
||||
private RuneLitePlusKeyListener keyListener = new RuneLitePlusKeyListener();
|
||||
private int entered = -1;
|
||||
private int enterIdx;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
entered = -1;
|
||||
enterIdx = 0;
|
||||
|
||||
if (getConfig(configManager).customPresence())
|
||||
if (config.customPresence())
|
||||
{
|
||||
ClientUI.currentPresenceName = ("RuneLitePlus");
|
||||
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
|
||||
}
|
||||
|
||||
if (config.customPresence())
|
||||
{
|
||||
RuneLiteProperties.discordAppID = rlPlusDiscordApp;
|
||||
discordService.close();
|
||||
discordService.init();
|
||||
}
|
||||
else
|
||||
{
|
||||
RuneLiteProperties.discordAppID = rlDiscordApp;
|
||||
discordService.close();
|
||||
discordService.init();
|
||||
}
|
||||
|
||||
entered = -1;
|
||||
enterIdx = 0;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -196,26 +186,20 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
{
|
||||
ClientUI.currentPresenceName = ("RuneLitePlus");
|
||||
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientUI.currentPresenceName = ("RuneLite");
|
||||
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
|
||||
}
|
||||
|
||||
if (config.customPresence())
|
||||
{
|
||||
RuneLiteProperties.discordAppID = rlPlusDiscordApp;
|
||||
discordService.close();
|
||||
discordService.init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientUI.currentPresenceName = ("RuneLite");
|
||||
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
|
||||
RuneLiteProperties.discordAppID = rlDiscordApp;
|
||||
discordService.close();
|
||||
discordService.init();
|
||||
}
|
||||
}
|
||||
|
||||
else if (!config.keyboardPin())
|
||||
{
|
||||
entered = -1;
|
||||
@@ -253,7 +237,6 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
}
|
||||
|
||||
// log.debug("Registering key listener");
|
||||
keyListener = new RuneLitePlusKeyListener();
|
||||
keyManager.registerKeyListener(keyListener);
|
||||
}
|
||||
|
||||
@@ -266,7 +249,6 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
entered = -1;
|
||||
enterIdx = 0;
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
keyListener = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class SkillCalculatorPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
CriticalItem.prepareItemCompositions(itemManager);
|
||||
CriticalItem.prepareItemDefinitions(itemManager);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -296,7 +296,7 @@ public enum CriticalItem
|
||||
private boolean ignoreBonus;
|
||||
|
||||
@Getter
|
||||
private ItemComposition composition;
|
||||
private ItemDefinition definition;
|
||||
|
||||
CriticalItem(int itemID, String category, Skill skill, int linkedItem)
|
||||
{
|
||||
@@ -304,7 +304,7 @@ public enum CriticalItem
|
||||
this.category = category;
|
||||
this.skill = skill;
|
||||
this.linkedItemId = linkedItem;
|
||||
this.composition = null;
|
||||
this.definition = null;
|
||||
this.ignoreBonus = false;
|
||||
}
|
||||
|
||||
@@ -401,11 +401,11 @@ public enum CriticalItem
|
||||
*
|
||||
* @param m ItemManager
|
||||
*/
|
||||
public static void prepareItemCompositions(ItemManager m)
|
||||
public static void prepareItemDefinitions(ItemManager m)
|
||||
{
|
||||
for (CriticalItem i : values())
|
||||
{
|
||||
i.composition = m.getItemComposition(i.getItemID());
|
||||
i.definition = m.getItemDefinition(i.getItemID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public class CriticalItemPanel extends JPanel
|
||||
infoContainer.setBorder(new MatteBorder(1, 0, 0, 0, Color.GRAY));
|
||||
|
||||
// Icon
|
||||
AsyncBufferedImage icon = itemManager.getImage(item.getItemID(), amount, item.getComposition().isStackable() || amount > 1);
|
||||
AsyncBufferedImage icon = itemManager.getImage(item.getItemID(), amount, item.getDefinition().isStackable() || amount > 1);
|
||||
image = new JLabel();
|
||||
image.setMinimumSize(ICON_SIZE);
|
||||
image.setMaximumSize(ICON_SIZE);
|
||||
@@ -144,7 +144,7 @@ public class CriticalItemPanel extends JPanel
|
||||
uiInfo.setBorder(new EmptyBorder(0, 5, 0, 0));
|
||||
uiInfo.setBackground(BACKGROUND_COLOR);
|
||||
|
||||
JShadowedLabel labelName = new JShadowedLabel(item.getComposition().getName());
|
||||
JShadowedLabel labelName = new JShadowedLabel(item.getDefinition().getName());
|
||||
labelName.setForeground(Color.WHITE);
|
||||
labelName.setVerticalAlignment(SwingUtilities.BOTTOM);
|
||||
|
||||
@@ -201,7 +201,7 @@ public class CriticalItemPanel extends JPanel
|
||||
panel.add(settingsButton, BorderLayout.LINE_END);
|
||||
}
|
||||
|
||||
panel.setToolTipText("<html>" + item.getComposition().getName()
|
||||
panel.setToolTipText("<html>" + item.getDefinition().getName()
|
||||
+ "<br/>xp: " + xp
|
||||
+ "<br/>Total: " + StackFormatter.quantityToStackSize((long) total) + "</html");
|
||||
|
||||
@@ -269,7 +269,7 @@ public class CriticalItemPanel extends JPanel
|
||||
for (Map.Entry<CriticalItem, Integer> e : linkedMap.entrySet())
|
||||
{
|
||||
// Icon
|
||||
AsyncBufferedImage icon = itemManager.getImage(e.getKey().getItemID(), e.getValue(), e.getKey().getComposition().isStackable() || e.getValue() > 1);
|
||||
AsyncBufferedImage icon = itemManager.getImage(e.getKey().getItemID(), e.getValue(), e.getKey().getDefinition().isStackable() || e.getValue() > 1);
|
||||
JLabel image = new JLabel();
|
||||
image.setMinimumSize(ICON_SIZE);
|
||||
image.setMaximumSize(ICON_SIZE);
|
||||
@@ -282,7 +282,7 @@ public class CriticalItemPanel extends JPanel
|
||||
icon.onChanged(resize);
|
||||
resize.run();
|
||||
|
||||
image.setToolTipText(e.getKey().getComposition().getName());
|
||||
image.setToolTipText(e.getKey().getDefinition().getName());
|
||||
|
||||
con.add(image, c);
|
||||
c.gridx++;
|
||||
@@ -366,7 +366,7 @@ public class CriticalItemPanel extends JPanel
|
||||
{
|
||||
this.setVisible(newAmount > 0 || forceVisible);
|
||||
this.amount = newAmount;
|
||||
AsyncBufferedImage icon = itemManager.getImage(item.getItemID(), amount, item.getComposition().isStackable() || amount > 1);
|
||||
AsyncBufferedImage icon = itemManager.getImage(item.getItemID(), amount, item.getDefinition().isStackable() || amount > 1);
|
||||
Runnable resize = () ->
|
||||
image.setIcon(new ImageIcon(icon.getScaledInstance((int) ICON_SIZE.getWidth(), (int) ICON_SIZE.getHeight(), Image.SCALE_SMOOTH)));
|
||||
icon.onChanged(resize);
|
||||
|
||||
@@ -55,7 +55,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import static net.runelite.api.Skill.SLAYER;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.Varbits;
|
||||
@@ -810,7 +810,7 @@ public class SlayerPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isValidComposition(NPCComposition composition)
|
||||
private boolean isValidComposition(NPCDefinition composition)
|
||||
{
|
||||
if (composition != null)
|
||||
{
|
||||
@@ -851,7 +851,7 @@ public class SlayerPlugin extends Plugin
|
||||
{
|
||||
if (!checkAsTokens)
|
||||
{
|
||||
if (name.contains(target) && isValidComposition(npc.getTransformedComposition()))
|
||||
if (name.contains(target) && isValidComposition(npc.getTransformedDefinition()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -859,7 +859,7 @@ public class SlayerPlugin extends Plugin
|
||||
else
|
||||
{
|
||||
String[] nameTokens = name.split(" ");
|
||||
if (contiguousSubsequenceMatches(nameTokens, target) && isValidComposition(npc.getTransformedComposition()))
|
||||
if (contiguousSubsequenceMatches(nameTokens, target) && isValidComposition(npc.getTransformedDefinition()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -874,7 +874,7 @@ public class SlayerPlugin extends Plugin
|
||||
|
||||
for (int target : targetIds)
|
||||
{
|
||||
if (id == target && isValidComposition(npc.getTransformedComposition()))
|
||||
if (id == target && isValidComposition(npc.getTransformedDefinition()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -102,7 +102,7 @@ public class TargetClickboxOverlay extends Overlay
|
||||
|
||||
case TILE:
|
||||
int size = 1;
|
||||
NPCComposition composition = actor.getTransformedComposition();
|
||||
NPCDefinition composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
@@ -135,7 +135,7 @@ public class TargetClickboxOverlay extends Overlay
|
||||
break;
|
||||
case TRUE_LOCATIONS:
|
||||
size = 1;
|
||||
composition = actor.getTransformedComposition();
|
||||
composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
{
|
||||
size = composition.getSize();
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.VarPlayer;
|
||||
@@ -184,7 +184,7 @@ public class SpecialCounterPlugin extends Plugin
|
||||
if (interacting instanceof NPC)
|
||||
{
|
||||
NPC npc = (NPC) interacting;
|
||||
NPCComposition composition = npc.getComposition();
|
||||
NPCDefinition composition = npc.getDefinition();
|
||||
int interactingId = npc.getId();
|
||||
|
||||
if (!ArrayUtils.contains(composition.getActions(), "Attack"))
|
||||
|
||||
@@ -35,7 +35,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
@@ -101,7 +101,7 @@ public class StatusBarsPlugin extends Plugin
|
||||
if (isNpc)
|
||||
{
|
||||
final NPC npc = (NPC) interacting;
|
||||
final NPCComposition npcComposition = npc.getComposition();
|
||||
final NPCDefinition npcComposition = npc.getDefinition();
|
||||
final List<String> npcMenuActions = Arrays.asList(npcComposition.getActions());
|
||||
if (npcMenuActions.contains("Attack") && config.toggleRestorationBars())
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
@@ -206,7 +206,7 @@ public class StonedLootTrackerPlugin extends Plugin
|
||||
loaded = true;
|
||||
for (UniqueItem i : UniqueItem.values())
|
||||
{
|
||||
ItemComposition c = itemManager.getItemComposition(i.getItemID());
|
||||
ItemDefinition c = itemManager.getItemDefinition(i.getItemID());
|
||||
for (String s : i.getActivities())
|
||||
{
|
||||
uniques.put(s.toUpperCase(), new UniqueItemPrepared(c.getLinkedNoteId(), itemManager.getItemPrice(i.getItemID()), i));
|
||||
@@ -522,7 +522,7 @@ public class StonedLootTrackerPlugin extends Plugin
|
||||
{
|
||||
return itemStacks.stream().map(itemStack ->
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemStack.getId());
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemStack.getId());
|
||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemStack.getId();
|
||||
final long price = itemManager.getItemPrice(realItemId);
|
||||
final long haPrice = itemManager.getAlchValue(realItemId);
|
||||
@@ -606,7 +606,7 @@ public class StonedLootTrackerPlugin extends Plugin
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
Collection<LootRecordCustom> data = getDataByName("Abyssal sire");
|
||||
ItemComposition c = itemManager.getItemComposition(itemID);
|
||||
ItemDefinition c = itemManager.getItemDefinition(itemID);
|
||||
LootTrackerItemEntry itemEntry = new LootTrackerItemEntry(c.getName(), itemID, 1, 0, 0, false);
|
||||
|
||||
log.debug("Received Unsired item: {}", c.getName());
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.EquipmentInventorySlot;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import static net.runelite.api.ItemID.ACCUMULATOR_MAX_CAPE;
|
||||
@@ -735,7 +735,7 @@ public class SuppliesTrackerPlugin extends Plugin
|
||||
*/
|
||||
private void buildEntries(int itemId, int count)
|
||||
{
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
||||
String name = itemComposition.getName();
|
||||
long calculatedPrice;
|
||||
|
||||
@@ -757,12 +757,12 @@ public class SuppliesTrackerPlugin extends Plugin
|
||||
if (isPizzaPie(name))
|
||||
{
|
||||
itemId = getFullVersionItemID(itemId);
|
||||
name = itemManager.getItemComposition(itemId).getName();
|
||||
name = itemManager.getItemDefinition(itemId).getName();
|
||||
}
|
||||
if (isCake(name, itemId))
|
||||
{
|
||||
itemId = getFullVersionItemID(itemId);
|
||||
name = itemManager.getItemComposition(itemId).getName();
|
||||
name = itemManager.getItemDefinition(itemId).getName();
|
||||
}
|
||||
|
||||
int newQuantity;
|
||||
|
||||
@@ -113,7 +113,7 @@ public abstract class RoomHandler
|
||||
{
|
||||
int size = 1;
|
||||
|
||||
NPCComposition composition = actor.getTransformedComposition();
|
||||
NPCDefinition composition = actor.getTransformedDefinition();
|
||||
if (composition != null)
|
||||
size = composition.getSize();
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GraphicChanged;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
@@ -736,7 +736,7 @@ public class TimersPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGraphicChanged(GraphicChanged event)
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
|
||||
@@ -745,14 +745,14 @@ public class TimersPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId())
|
||||
if (config.showImbuedHeart() && actor.getSpotAnimation() == IMBUEDHEART.getGraphicId())
|
||||
{
|
||||
createGameTimer(IMBUEDHEART);
|
||||
}
|
||||
|
||||
if (config.showFreezes())
|
||||
{
|
||||
if (actor.getGraphic() == BIND.getGraphicId())
|
||||
if (actor.getSpotAnimation() == BIND.getGraphicId())
|
||||
{
|
||||
if (client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
&& !client.getWorldType().contains(WorldType.SEASONAL_DEADMAN)
|
||||
@@ -766,7 +766,7 @@ public class TimersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (actor.getGraphic() == SNARE.getGraphicId())
|
||||
if (actor.getSpotAnimation() == SNARE.getGraphicId())
|
||||
{
|
||||
if (client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
&& !client.getWorldType().contains(WorldType.SEASONAL_DEADMAN)
|
||||
@@ -780,7 +780,7 @@ public class TimersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (actor.getGraphic() == ENTANGLE.getGraphicId())
|
||||
if (actor.getSpotAnimation() == ENTANGLE.getGraphicId())
|
||||
{
|
||||
if (client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
&& !client.getWorldType().contains(WorldType.SEASONAL_DEADMAN)
|
||||
@@ -797,19 +797,19 @@ public class TimersPlugin extends Plugin
|
||||
// downgrade freeze based on graphic, if at the same tick as the freeze message
|
||||
if (freezeTime == client.getTickCount())
|
||||
{
|
||||
if (actor.getGraphic() == ICERUSH.getGraphicId())
|
||||
if (actor.getSpotAnimation() == ICERUSH.getGraphicId())
|
||||
{
|
||||
removeGameTimer(ICEBARRAGE);
|
||||
freezeTimer = createGameTimer(ICERUSH);
|
||||
}
|
||||
|
||||
if (actor.getGraphic() == ICEBURST.getGraphicId())
|
||||
if (actor.getSpotAnimation() == ICEBURST.getGraphicId())
|
||||
{
|
||||
removeGameTimer(ICEBARRAGE);
|
||||
freezeTimer = createGameTimer(ICEBURST);
|
||||
}
|
||||
|
||||
if (actor.getGraphic() == ICEBLITZ.getGraphicId())
|
||||
if (actor.getSpotAnimation() == ICEBLITZ.getGraphicId())
|
||||
{
|
||||
removeGameTimer(ICEBARRAGE);
|
||||
freezeTimer = createGameTimer(ICEBLITZ);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.timetracking.farming;
|
||||
|
||||
import net.runelite.api.vars.Autoweed;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.time.Instant;
|
||||
@@ -34,7 +35,6 @@ import javax.annotation.Nullable;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.vars.Autoweed;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.timetracking.SummaryState;
|
||||
|
||||
@@ -95,30 +95,30 @@ public class TMorph extends Plugin
|
||||
Player player = client.getLocalPlayer();
|
||||
|
||||
if (player == null
|
||||
|| player.getPlayerComposition() == null
|
||||
|| player.getPlayerAppearance() == null
|
||||
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
||||
|| client.getViewportWidget() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int mainhandID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int mainhandID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.WEAPON), 0);
|
||||
final int offhandID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int offhandID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.SHIELD), 0);
|
||||
final int helmetID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int helmetID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.HELMET), 0);
|
||||
final int capeID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int capeID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.CAPE), 0);
|
||||
final int neckID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int neckID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.AMULET), 0);
|
||||
final int bodyID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int bodyID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.TORSO), 0);
|
||||
final int legsID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int legsID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.LEGS), 0);
|
||||
final int bootsID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int bootsID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.BOOTS), 0);
|
||||
final int glovesID = ObjectUtils.defaultIfNull(player.getPlayerComposition().
|
||||
final int glovesID = ObjectUtils.defaultIfNull(player.getPlayerAppearance().
|
||||
getEquipmentId(KitType.HANDS), 0);
|
||||
|
||||
if (config.mageSwap())
|
||||
@@ -129,7 +129,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (mainhandID == config.targetMainhandMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (offhandID == config.targetOffhandMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (helmetID == config.targetHelmetMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (capeID == config.targetCapeMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (neckID == config.targetNeckMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bodyID == config.targetBodyMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (legsID == config.targetLegsMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bootsID == config.targetBootsMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (glovesID == config.targetGlovesMage())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesMage() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesMage() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (mainhandID == config.targetMainhandRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (offhandID == config.targetOffhandRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (helmetID == config.targetHelmetRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (capeID == config.targetCapeRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (neckID == config.targetNeckRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,7 +272,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bodyID == config.targetBodyRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (legsID == config.targetLegsRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bootsID == config.targetBootsRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (glovesID == config.targetGlovesRange())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesRange() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesRange() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (mainhandID == config.targetMainhandMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.WEAPON.getIndex()] = config.MainhandMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (offhandID == config.targetOffhandMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.SHIELD.getIndex()] = config.OffhandMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,7 +335,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (helmetID == config.targetHelmetMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HELMET.getIndex()] = config.HelmetMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,7 +345,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (capeID == config.targetCapeMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.CAPE.getIndex()] = config.CapeMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (neckID == config.targetNeckMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.AMULET.getIndex()] = config.NeckMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bodyID == config.targetBodyMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.TORSO.getIndex()] = config.BodyMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (legsID == config.targetLegsMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.LEGS.getIndex()] = config.LegsMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,7 +385,7 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (bootsID == config.targetBootsMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.BOOTS.getIndex()] = config.BootsMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -395,11 +395,11 @@ public class TMorph extends Plugin
|
||||
{
|
||||
if (glovesID == config.targetGlovesMelee())
|
||||
{
|
||||
player.getPlayerComposition().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesMelee() + 512;
|
||||
player.getPlayerAppearance().getEquipmentIds()[KitType.HANDS.getIndex()] = config.GlovesMelee() + 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.getPlayerComposition().setHash();
|
||||
player.getPlayerAppearance().setHash();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public class WhaleWatchersPlugin extends Plugin
|
||||
if (config.gloryWarning() && event.getItemContainer() == client.getItemContainer(InventoryID.EQUIPMENT))
|
||||
{
|
||||
final int amuletID = ObjectUtils.defaultIfNull(client.getLocalPlayer()
|
||||
.getPlayerComposition().getEquipmentId(KitType.AMULET), 0);
|
||||
.getPlayerAppearance().getEquipmentId(KitType.AMULET), 0);
|
||||
displayGloryOverlay = amuletID == ItemID.AMULET_OF_GLORY;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -35,8 +35,8 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
@@ -216,7 +216,7 @@ public class WikiPlugin extends Plugin
|
||||
{
|
||||
type = "item";
|
||||
id = itemManager.canonicalize(ev.getId());
|
||||
name = itemManager.getItemComposition(id).getName();
|
||||
name = itemManager.getItemDefinition(id).getName();
|
||||
location = null;
|
||||
break;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ public class WikiPlugin extends Plugin
|
||||
{
|
||||
type = "npc";
|
||||
NPC npc = client.getCachedNPCs()[ev.getId()];
|
||||
NPCComposition nc = npc.getTransformedComposition();
|
||||
NPCDefinition nc = npc.getTransformedDefinition();
|
||||
id = nc.getId();
|
||||
name = nc.getName();
|
||||
location = npc.getWorldLocation();
|
||||
@@ -233,7 +233,7 @@ public class WikiPlugin extends Plugin
|
||||
case SPELL_CAST_ON_GAME_OBJECT:
|
||||
{
|
||||
type = "object";
|
||||
ObjectComposition lc = client.getObjectDefinition(ev.getId());
|
||||
ObjectDefinition lc = client.getObjectDefinition(ev.getId());
|
||||
if (lc.getImpostorIds() != null)
|
||||
{
|
||||
lc = lc.getImpostor();
|
||||
|
||||
@@ -26,16 +26,18 @@
|
||||
*/
|
||||
package net.runelite.client.rs;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import io.sigpipe.jbsdiff.InvalidHeaderException;
|
||||
import io.sigpipe.jbsdiff.Patch;
|
||||
import net.runelite.api.Client;
|
||||
import java.applet.Applet;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
@@ -51,27 +53,25 @@ import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.AUTO;
|
||||
import static net.runelite.client.RuneLite.RUNELITE_DIR;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.CUSTOM;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.NONE;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.apache.commons.compress.compressors.CompressorException;
|
||||
|
||||
@Slf4j
|
||||
@Singleton
|
||||
public class ClientLoader
|
||||
{
|
||||
private static final File CUSTOMFILE = new File("replace me!");
|
||||
private static final File CUSTOMFILE = new File("./injected-client/target/injected-client-1.0-SNAPSHOT.jar");
|
||||
private final ClientConfigLoader clientConfigLoader;
|
||||
private ClientUpdateCheckMode updateCheckMode;
|
||||
public static boolean useLocalInjected = false;
|
||||
|
||||
@Inject
|
||||
private ClientLoader(
|
||||
@Named("updateCheckMode") final ClientUpdateCheckMode updateCheckMode,
|
||||
final ClientConfigLoader clientConfigLoader)
|
||||
@Named("updateCheckMode") final ClientUpdateCheckMode updateCheckMode,
|
||||
final ClientConfigLoader clientConfigLoader)
|
||||
{
|
||||
this.updateCheckMode = updateCheckMode;
|
||||
this.clientConfigLoader = clientConfigLoader;
|
||||
@@ -79,11 +79,7 @@ public class ClientLoader
|
||||
|
||||
public Applet load()
|
||||
{
|
||||
if (updateCheckMode == NONE)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
updateCheckMode = CUSTOM;
|
||||
try
|
||||
{
|
||||
Manifest manifest = new Manifest();
|
||||
@@ -97,8 +93,8 @@ public class ClientLoader
|
||||
String initialJar = config.getInitialJar();
|
||||
URL url = new URL(codebase + initialJar);
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
@@ -145,38 +141,38 @@ public class ClientLoader
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (updateCheckMode == AUTO)
|
||||
{
|
||||
ByteArrayOutputStream patchOs = new ByteArrayOutputStream(756 * 1024);
|
||||
int patchCount = 0;
|
||||
|
||||
for (Map.Entry<String, byte[]> file : zipFile.entrySet())
|
||||
{
|
||||
byte[] bytes;
|
||||
try (InputStream is = ClientLoader.class.getResourceAsStream("/patch/" + file.getKey() + ".bs"))
|
||||
{
|
||||
if (is == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bytes = ByteStreams.toByteArray(is);
|
||||
}
|
||||
|
||||
patchOs.reset();
|
||||
Patch.patch(file.getValue(), bytes, patchOs);
|
||||
file.setValue(patchOs.toByteArray());
|
||||
|
||||
++patchCount;
|
||||
}
|
||||
|
||||
log.info("Patched {} classes", patchCount);
|
||||
}
|
||||
|
||||
if (updateCheckMode == CUSTOM)
|
||||
{
|
||||
JarInputStream fis = new JarInputStream(new FileInputStream(CUSTOMFILE));
|
||||
URL url = new URL("https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/injected-client.jar");
|
||||
ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream());
|
||||
File LOCAL_INJECTED_CLIENT = new File("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar");
|
||||
File INJECTED_CLIENT = new File(RUNELITE_DIR + "/injected-client.jar");
|
||||
INJECTED_CLIENT.mkdirs();
|
||||
if (INJECTED_CLIENT.exists())
|
||||
{
|
||||
if (getFileSize(INJECTED_CLIENT.toURI().toURL()) != getFileSize(url))
|
||||
{
|
||||
INJECTED_CLIENT.delete();
|
||||
INJECTED_CLIENT.createNewFile();
|
||||
System.out.println("Updating Injected Client");
|
||||
updateInjectedClient(readableByteChannel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
INJECTED_CLIENT.createNewFile();
|
||||
System.out.println("Initializing Inject Client");
|
||||
updateInjectedClient(readableByteChannel);
|
||||
}
|
||||
JarInputStream fis;
|
||||
if (useLocalInjected)
|
||||
{
|
||||
fis = new JarInputStream(new FileInputStream(LOCAL_INJECTED_CLIENT));
|
||||
}
|
||||
else
|
||||
{
|
||||
fis = new JarInputStream(new FileInputStream(INJECTED_CLIENT));
|
||||
}
|
||||
byte[] tmp = new byte[4096];
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream(756 * 1024);
|
||||
for (; ; )
|
||||
@@ -226,18 +222,18 @@ public class ClientLoader
|
||||
|
||||
if (rs instanceof Client)
|
||||
{
|
||||
log.info("client-patch {}", ((Client) rs).getBuildID());
|
||||
log.info("client-patch {}", "420 blaze it RL pricks");
|
||||
}
|
||||
|
||||
return rs;
|
||||
}
|
||||
catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException | SecurityException | VerificationException | CertificateException | CompressorException | InvalidHeaderException e)
|
||||
catch (IOException | ClassNotFoundException | InstantiationException | IllegalAccessException | SecurityException | VerificationException | CertificateException e)
|
||||
{
|
||||
if (e instanceof ClassNotFoundException)
|
||||
{
|
||||
log.error("Unable to load client - class not found. This means you"
|
||||
+ " are not running RuneLite with Maven as the client patch"
|
||||
+ " is not in your classpath.");
|
||||
+ " are not running RuneLite with Maven as the client patch"
|
||||
+ " is not in your classpath.");
|
||||
}
|
||||
|
||||
log.error("Error loading RS!", e);
|
||||
@@ -245,6 +241,47 @@ public class ClientLoader
|
||||
}
|
||||
}
|
||||
|
||||
private static int getFileSize(URL url)
|
||||
{
|
||||
URLConnection conn = null;
|
||||
try
|
||||
{
|
||||
conn = url.openConnection();
|
||||
if (conn instanceof HttpURLConnection)
|
||||
{
|
||||
((HttpURLConnection) conn).setRequestMethod("HEAD");
|
||||
}
|
||||
conn.getInputStream();
|
||||
return conn.getContentLength();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (conn instanceof HttpURLConnection)
|
||||
{
|
||||
((HttpURLConnection) conn).disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateInjectedClient(ReadableByteChannel readableByteChannel)
|
||||
{
|
||||
File INJECTED_CLIENT = new File(RUNELITE_DIR, "injected-client.jar");
|
||||
try
|
||||
{
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(INJECTED_CLIENT);
|
||||
fileOutputStream.getChannel()
|
||||
.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static Certificate[] getJagexCertificateChain() throws CertificateException
|
||||
{
|
||||
CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
|
||||
|
||||
@@ -29,5 +29,6 @@ public enum ClientUpdateCheckMode
|
||||
AUTO,
|
||||
NONE,
|
||||
VANILLA,
|
||||
CUSTOM
|
||||
CUSTOM,
|
||||
PATCH
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ final class ClientPanel extends JPanel
|
||||
|
||||
add(client, BorderLayout.CENTER);
|
||||
|
||||
// This causes the whole game frame to be redrawn each frame instead
|
||||
// api.renderableThis causes the whole game frame to be redrawn each frame instead
|
||||
// of only the viewport, so we can hook to MainBufferProvider#draw
|
||||
// and draw anywhere without it leaving artifacts
|
||||
if (client instanceof Client)
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameObject;
|
||||
import net.runelite.api.ObjectComposition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.Scene;
|
||||
import net.runelite.api.Tile;
|
||||
|
||||
@@ -34,8 +34,8 @@ class ArrowUtil
|
||||
}
|
||||
|
||||
// Check impostors
|
||||
final ObjectComposition comp = client.getObjectDefinition(object.getId());
|
||||
final ObjectComposition impostor = comp.getImpostorIds() != null ? comp.getImpostor() : comp;
|
||||
final ObjectDefinition comp = client.getObjectDefinition(object.getId());
|
||||
final ObjectDefinition impostor = comp.getImpostorIds() != null ? comp.getImpostor() : comp;
|
||||
|
||||
if (impostor != null && objectIDs.contains(impostor.getId()))
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ import javax.swing.GrayFilter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.IndexedSprite;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Sprite;
|
||||
|
||||
/**
|
||||
* Various Image/BufferedImage utilities.
|
||||
@@ -426,7 +426,7 @@ public class ImageUtil
|
||||
* @param client Current client instance
|
||||
* @return The buffered image as a sprite image
|
||||
*/
|
||||
public static SpritePixels getImageSpritePixels(BufferedImage image, Client client)
|
||||
public static Sprite getImageSprite(BufferedImage image, Client client)
|
||||
{
|
||||
int[] pixels = new int[image.getWidth() * image.getHeight()];
|
||||
|
||||
@@ -451,7 +451,7 @@ public class ImageUtil
|
||||
log.debug("PixelGrabber was interrupted: ", ex);
|
||||
}
|
||||
|
||||
return client.createSpritePixels(pixels, image.getWidth(), image.getHeight());
|
||||
return client.createSprite(pixels, image.getWidth(), image.getHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.TreeMap;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemComposition;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WorldType;
|
||||
@@ -90,7 +90,7 @@ public class PvPUtil
|
||||
{
|
||||
int value = (itemManager.getItemPrice(i.getId()) * i.getQuantity());
|
||||
|
||||
final ItemComposition itemComposition = itemManager.getItemComposition(i.getId());
|
||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(i.getId());
|
||||
if (!itemComposition.isTradeable() && value == 0)
|
||||
{
|
||||
value = itemComposition.getPrice() * i.getQuantity();
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
public class Artifact {
|
||||
|
||||
String hash;
|
||||
String name;
|
||||
String path;
|
||||
String size;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,328 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class Bootstrap {
|
||||
|
||||
Artifact[] artifacts = getArtifacts();
|
||||
Client client = new Client();
|
||||
String[] clientJvm9Arguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Djna.nosys=true"
|
||||
};
|
||||
String[] clientJvmArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
String[] dependencyHashes;
|
||||
String[] launcherArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Drunelite.launcher.nojvm=true",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
|
||||
public Bootstrap(){}
|
||||
|
||||
public Artifact[] getArtifacts() {
|
||||
try {
|
||||
artifacts = new Artifact[42];
|
||||
|
||||
//Static artifacts
|
||||
artifacts[0] = new Artifact();
|
||||
artifacts[0].hash = "b12331da8683e5f107d294adeebb83ecf9124abc1db533554d2a8d3c62832d75";
|
||||
artifacts[0].name = "asm-all-6.0_BETA.jar";
|
||||
artifacts[0].path = "https://mvn.runelite.net/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar";
|
||||
artifacts[0].size = "265176";
|
||||
artifacts[1] = new Artifact();
|
||||
artifacts[1].hash = "37abf0103ce5318bfda004fabc004c75ed0dc6d392a8459175692ab7eac97083";
|
||||
artifacts[1].name = "naturalmouse-2.0.0.jar";
|
||||
artifacts[1].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/naturalmouse-2.0.0.jar";
|
||||
artifacts[1].size = "3168921";
|
||||
artifacts[2] = new Artifact();
|
||||
artifacts[2].hash = "50d1e07f11827672249dee9ce8a23691fc59f663deed084bb7b52a4f778d5fbc";
|
||||
artifacts[2].name = "jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].size = "3168921";
|
||||
artifacts[4] = new Artifact();
|
||||
artifacts[4].hash = "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79";
|
||||
artifacts[4].name = "slf4j-api-1.7.25.jar";
|
||||
artifacts[4].path = "https://mvn.runelite.net/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar";
|
||||
artifacts[4].size = "41203";
|
||||
artifacts[5] = new Artifact();
|
||||
artifacts[5].hash = "fb53f8539e7fcb8f093a56e138112056ec1dc809ebb020b59d8a36a5ebac37e0";
|
||||
artifacts[5].name = "logback-classic-1.2.3.jar";
|
||||
artifacts[5].path = "https://mvn.runelite.net/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar";
|
||||
artifacts[5].size = "290339";
|
||||
artifacts[6] = new Artifact();
|
||||
artifacts[6].hash = "5946d837fe6f960c02a53eda7a6926ecc3c758bbdd69aa453ee429f858217f22";
|
||||
artifacts[6].name = "logback-core-1.2.3.jar";
|
||||
artifacts[6].path = "https://mvn.runelite.net/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar";
|
||||
artifacts[6].size = "471901";
|
||||
artifacts[7] = new Artifact();
|
||||
artifacts[7].hash = "9f0c8d50fa4b79b6ff1502dbec8502179d6b9497cacbe17a13074001aed537ec";
|
||||
artifacts[7].name = "jopt-simple-5.0.1.jar";
|
||||
artifacts[7].path = "https://mvn.runelite.net/net/sf/jopt-simple/jopt-simple/5.0.1/jopt-simple-5.0.1.jar";
|
||||
artifacts[7].size = "78826";
|
||||
artifacts[8] = new Artifact();
|
||||
artifacts[8].hash = "5be9a7d05ba0ccd74708bc8018ae412255f85843c0b92302e9b9befa6ed52564";
|
||||
artifacts[8].name = "guava-23.2-jre.jar";
|
||||
artifacts[8].path = "https://mvn.runelite.net/com/google/guava/guava/23.2-jre/guava-23.2-jre.jar";
|
||||
artifacts[8].size = "2649860";
|
||||
artifacts[9] = new Artifact();
|
||||
artifacts[9].hash = "905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed";
|
||||
artifacts[9].name = "jsr305-1.3.9.jar";
|
||||
artifacts[9].path = "https://mvn.runelite.net/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar";
|
||||
artifacts[9].size = "33015";
|
||||
artifacts[10] = new Artifact();
|
||||
artifacts[10].hash = "cb4cfad870bf563a07199f3ebea5763f0dec440fcda0b318640b1feaa788656b";
|
||||
artifacts[10].name = "error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].path = "https://mvn.runelite.net/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].size = "12078";
|
||||
artifacts[11] = new Artifact();
|
||||
artifacts[11].hash = "2994a7eb78f2710bd3d3bfb639b2c94e219cedac0d4d084d516e78c16dddecf6";
|
||||
artifacts[11].name = "j2objc-annotations-1.1.jar";
|
||||
artifacts[11].path = "https://mvn.runelite.net/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar";
|
||||
artifacts[11].size = "8782";
|
||||
artifacts[12] = new Artifact();
|
||||
artifacts[12].hash = "2068320bd6bad744c3673ab048f67e30bef8f518996fa380033556600669905d";
|
||||
artifacts[12].name = "animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].path = "https://mvn.runelite.net/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].size = "3482";
|
||||
artifacts[13] = new Artifact();
|
||||
artifacts[13].hash = "9264c6931c431e928dc64adc842584d5f57d17b2f3aff29221f2b3fdea673dad";
|
||||
artifacts[13].name = "guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].path = "https://mvn.runelite.net/com/google/inject/guice/4.1.0/guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].size = "428603";
|
||||
artifacts[14] = new Artifact();
|
||||
artifacts[14].hash = "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff";
|
||||
artifacts[14].name = "javax.inject-1.jar";
|
||||
artifacts[14].path = "https://mvn.runelite.net/javax/inject/javax.inject/1/javax.inject-1.jar";
|
||||
artifacts[14].size = "2497";
|
||||
artifacts[15] = new Artifact();
|
||||
artifacts[15].hash = "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08";
|
||||
artifacts[15].name = "aopalliance-1.0.jar";
|
||||
artifacts[15].path = "https://mvn.runelite.net/aopalliance/aopalliance/1.0/aopalliance-1.0.jar";
|
||||
artifacts[15].size = "4467";
|
||||
artifacts[16] = new Artifact();
|
||||
artifacts[16].hash = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81";
|
||||
artifacts[16].name = "gson-2.8.5.jar";
|
||||
artifacts[16].path = "https://mvn.runelite.net/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar";
|
||||
artifacts[16].size = "241622";
|
||||
artifacts[17] = new Artifact();
|
||||
artifacts[17].hash = "0467d25f408428824d5c9c09ec60ee1f0bc341d9bf48971a77fd14939a826c83";
|
||||
artifacts[17].name = "substance-8.0.02.jar";
|
||||
artifacts[17].path = "https://repo.runelite.net/net/runelite/pushingpixels/substance/8.0.02/substance-8.0.02.jar";
|
||||
artifacts[17].size = "1589195";
|
||||
artifacts[18] = new Artifact();
|
||||
artifacts[18].hash = "3214e1c23d549d5d67c91da4da1ef33c5248470bb824f91cbe8f9e0beea59eef";
|
||||
artifacts[18].name = "trident-1.5.00.jar";
|
||||
artifacts[18].path = "https://repo.runelite.net/net/runelite/pushingpixels/trident/1.5.00/trident-1.5.00.jar";
|
||||
artifacts[18].size = "79726";
|
||||
artifacts[19] = new Artifact();
|
||||
artifacts[19].hash = "d4a57bbc1627da7c391308fd0fe910b83170fb66afd117236a5b111d2db1590b";
|
||||
artifacts[19].name = "commons-text-1.2.jar";
|
||||
artifacts[19].path = "https://mvn.runelite.net/org/apache/commons/commons-text/1.2/commons-text-1.2.jar";
|
||||
artifacts[19].size = "136544";
|
||||
artifacts[20] = new Artifact();
|
||||
artifacts[20].hash = "6e8dc31e046508d9953c96534edf0c2e0bfe6f468966b5b842b3f87e43b6a847";
|
||||
artifacts[20].name = "commons-lang3-3.7.jar";
|
||||
artifacts[20].path = "https://mvn.runelite.net/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar";
|
||||
artifacts[20].size = "499634";
|
||||
artifacts[21] = new Artifact();
|
||||
artifacts[21].hash = "e74603dc77b4183f108480279dbbf7fed3ac206069478636406c1fb45e83b31a";
|
||||
artifacts[21].name = "jogl-all-2.3.2.jar";
|
||||
artifacts[21].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2.jar";
|
||||
artifacts[21].size = "3414448";
|
||||
artifacts[22] = new Artifact();
|
||||
artifacts[22].hash = "8c53b1884cef19309d34fd10a94b010136d9d6de9a88c386f46006fb47acab5d";
|
||||
artifacts[22].name = "jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].size = "240721";
|
||||
artifacts[23] = new Artifact();
|
||||
artifacts[23].hash = "507a0e6bd1ee4e81c3dfb287783af93775864eec742988d4162f98ce0cbac9d6";
|
||||
artifacts[23].name = "jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].size = "209445";
|
||||
artifacts[24] = new Artifact();
|
||||
artifacts[24].hash = "82637302ae9effdf7d6f302e1050ad6aee3b13019914ddda5b502b9faa980216";
|
||||
artifacts[24].name = "jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].size = "224010";
|
||||
artifacts[25] = new Artifact();
|
||||
artifacts[25].hash = "f474ef2ef01be24ec811d3858b0f4bc5659076975f4a58ddd79abd787e9305c7";
|
||||
artifacts[25].name = "jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].size = "217274";
|
||||
artifacts[26] = new Artifact();
|
||||
artifacts[26].hash = "084844543b18f7ff71b4c0437852bd22f0cb68d7e44c2c611c1bbea76f8c6fdf";
|
||||
artifacts[26].name = "gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].size = "345605";
|
||||
artifacts[27] = new Artifact();
|
||||
artifacts[27].hash = "3474017422eff384db466bdb56c96c61220c43133a9da6329cf1781bea16c6b6";
|
||||
artifacts[27].name = "gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].size = "8159";
|
||||
artifacts[28] = new Artifact();
|
||||
artifacts[28].hash = "4eeed9fc2ebea5b9dc48a342b9478d127e989a2e1aa7129b512a98ec75cde338";
|
||||
artifacts[28].name = "gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].size = "7577";
|
||||
artifacts[29] = new Artifact();
|
||||
artifacts[29].hash = "f2dfd1800202059cf7e0294db5d57755147304e6eb220a9277526dbe6842bde2";
|
||||
artifacts[29].name = "gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].size = "4149";
|
||||
artifacts[30] = new Artifact();
|
||||
artifacts[30].hash = "1365d463f98c0abec92f3ad6b35aa4b53a9599a517800cf99fdabea6712ca7ec";
|
||||
artifacts[30].name = "gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].size = "4130";
|
||||
artifacts[31] = new Artifact();
|
||||
artifacts[31].hash = "7b7ae00e2aa98c3b2b5ac76e793e2c9b752bf51c86c54654dbd473843a25f1aa";
|
||||
artifacts[31].name = "jbsdiff-1.0.jar";
|
||||
artifacts[31].path = "https://mvn.runelite.net/io/sigpipe/jbsdiff/1.0/jbsdiff-1.0.jar";
|
||||
artifacts[31].size = "24589";
|
||||
artifacts[32] = new Artifact();
|
||||
artifacts[32].hash = "55bbfe26cee9296fd5b7c0d47ce6a00ea4dd572e235b63e9bb4eaf6f802315e4";
|
||||
artifacts[32].name = "commons-compress-1.5.jar";
|
||||
artifacts[32].path = "https://mvn.runelite.net/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar";
|
||||
artifacts[32].size = "256241";
|
||||
artifacts[33] = new Artifact();
|
||||
artifacts[33].hash = "fbc9de96a0cc193a125b4008dbc348e9ed54e5e13fc67b8ed40e645d303cc51b";
|
||||
artifacts[33].name = "jna-4.5.1.jar";
|
||||
artifacts[33].path = "https://mvn.runelite.net/net/java/dev/jna/jna/4.5.1/jna-4.5.1.jar";
|
||||
artifacts[33].size = "1440662";
|
||||
artifacts[34] = new Artifact();
|
||||
artifacts[34].hash = "84c8667555ee8dd91fef44b451419f6f16f71f727d5fc475a10c2663eba83abb";
|
||||
artifacts[34].name = "jna-platform-4.5.1.jar";
|
||||
artifacts[34].path = "https://mvn.runelite.net/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar";
|
||||
artifacts[34].size = "2327547";
|
||||
artifacts[38] = new Artifact();
|
||||
artifacts[38].hash = "f55abda036da75e1af45bd43b9dfa79b2a3d90905be9cb38687c6621597a8165";
|
||||
artifacts[38].name = "okhttp-3.7.0.jar";
|
||||
artifacts[38].path = "https://mvn.runelite.net/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar";
|
||||
artifacts[38].size = "394987";
|
||||
artifacts[39] = new Artifact();
|
||||
artifacts[39].hash = "bfe7dfe483c37137966a1690f0c7d0b448ba217902c1fed202aaffdbba3291ae";
|
||||
artifacts[39].name = "okio-1.12.0.jar";
|
||||
artifacts[39].path = "https://mvn.runelite.net/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar";
|
||||
artifacts[39].size = "81088";
|
||||
artifacts[40] = new Artifact();
|
||||
artifacts[40].hash = "9d4924588d6280c7516db3a4b7298306db5b6f0d1cdf568ce738309b5660f008";
|
||||
artifacts[40].name = "commons-csv-1.4.jar";
|
||||
artifacts[40].path = "https://mvn.runelite.net/org/apache/commons/commons-csv/1.4/commons-csv-1.4.jar";
|
||||
artifacts[40].size = "39978";
|
||||
artifacts[41] = new Artifact();
|
||||
artifacts[41].hash = "7e26a8d043418f2f22d5f6a3083a9a131817009ee8cd72c004e83b50d1849a7c";
|
||||
artifacts[41].name = "discord-1.1.jar";
|
||||
artifacts[41].path = "https://repo.runelite.net/net/runelite/discord/1.1/discord-1.1.jar";
|
||||
artifacts[41].size = "617294";
|
||||
|
||||
//Dynamic artifacts
|
||||
artifacts[3] = new Artifact();
|
||||
artifacts[3].name = "client-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[3].hash = getChecksumFile("./runelite-client/target/"+artifacts[3].name);
|
||||
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[3].name;
|
||||
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/"+artifacts[3].name));
|
||||
artifacts[35] = new Artifact();
|
||||
artifacts[35].name = "runelite-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[35].hash = getChecksumFile("./runelite-api/target/"+artifacts[35].name);
|
||||
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[35].name;
|
||||
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/"+artifacts[35].name));
|
||||
artifacts[36] = new Artifact();
|
||||
artifacts[36].name = "runescape-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[36].hash = getChecksumFile("./runescape-api/target/"+artifacts[36].name);
|
||||
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[36].name;
|
||||
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/"+artifacts[36].name));
|
||||
artifacts[37] = new Artifact();
|
||||
artifacts[37].name = "http-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[37].hash = getChecksumFile("./http-api/target/"+artifacts[37].name);
|
||||
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[37].name;
|
||||
artifacts[37].size = Long.toString(getFileSize("./http-api/target/"+artifacts[37].name));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getChecksumObject(Serializable object) throws IOException, NoSuchAlgorithmException {
|
||||
ByteArrayOutputStream baos = null;
|
||||
ObjectOutputStream oos = null;
|
||||
try {
|
||||
baos = new ByteArrayOutputStream();
|
||||
oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(object);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] thedigest = md.digest(baos.toByteArray());
|
||||
return DatatypeConverter.printHexBinary(thedigest);
|
||||
} finally {
|
||||
oos.close();
|
||||
baos.close();
|
||||
}
|
||||
}
|
||||
private static String getChecksumFile(String filepath) throws IOException {
|
||||
System.out.println("Generating Hash for "+filepath);
|
||||
MessageDigest md = null;
|
||||
try {
|
||||
md = MessageDigest.getInstance("SHA-256");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try (DigestInputStream dis = new DigestInputStream(new FileInputStream(filepath), md)) {
|
||||
while (dis.read() != -1) ; //empty loop to clear the data
|
||||
md = dis.getMessageDigest();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return bytesToHex(md.digest());
|
||||
|
||||
}
|
||||
|
||||
private static String bytesToHex(byte[] hashInBytes) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : hashInBytes) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
private long getFileSize(String fileLocation) {
|
||||
File f = new File(fileLocation);
|
||||
return f.length();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Bootstrapper {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
|
||||
try {
|
||||
FileWriter fw = new FileWriter("./bootstrap.json");
|
||||
gson.toJson(new Bootstrap(), fw);
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
public class Client {
|
||||
|
||||
String artifactId = "client";
|
||||
String classifier = "";
|
||||
String extension = "jar";
|
||||
String groupId = "net.runelite";
|
||||
String properties = "";
|
||||
String version = "1.5.27";
|
||||
}
|
||||
Reference in New Issue
Block a user