diff --git a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java index dbcceda631..7e035757ca 100644 --- a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java +++ b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java @@ -25,13 +25,9 @@ package net.runelite.http.api; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import net.runelite.http.api.item.ItemEquipmentStats; -import net.runelite.http.api.item.ItemPrice; -import net.runelite.http.api.item.ItemStats; -import net.runelite.http.api.util.TypeAdapters; import okhttp3.HttpUrl; import okhttp3.Interceptor; +import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; @@ -60,12 +56,9 @@ public class RuneLiteAPI public static final String RUNELITE_AUTH = "RUNELITE-AUTH"; public static final OkHttpClient CLIENT; - public static final Gson GSON = new GsonBuilder() - .setPrettyPrinting() - .registerTypeAdapter(ItemStats.class, TypeAdapters.ITEMSTATS) - .registerTypeAdapter(ItemEquipmentStats.class, TypeAdapters.EQUIPMENTSTATS) - .registerTypeAdapter(ItemPrice.class, TypeAdapters.ITEMPRICE) - .create(); + public static final Gson GSON = new Gson(); + public static final MediaType JSON = MediaType.parse("application/json"); + public static String userAgent; private static final String BASE = "https://api.runelite.net"; private static final String WSBASE = "https://api.runelite.net/ws"; @@ -76,8 +69,6 @@ public class RuneLiteAPI private static final String MAVEN_METADATA = "http://repo.runelite.net/net/runelite/runelite-parent/maven-metadata.xml"; private static final Properties properties = new Properties(); - private static String userAgent; - private static String version; private static String upstreamVersion; private static int rsVersion; diff --git a/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeClient.java b/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeClient.java index f016468e92..71ea20b533 100644 --- a/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeClient.java +++ b/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeClient.java @@ -30,10 +30,10 @@ import java.util.UUID; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.runelite.http.api.RuneLiteAPI; +import static net.runelite.http.api.RuneLiteAPI.JSON; import okhttp3.Call; import okhttp3.Callback; import okhttp3.HttpUrl; -import okhttp3.MediaType; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; @@ -42,7 +42,6 @@ import okhttp3.Response; @AllArgsConstructor public class GrandExchangeClient { - private static final MediaType JSON = MediaType.parse("application/json"); private static final Gson GSON = RuneLiteAPI.GSON; private final UUID uuid; diff --git a/http-api/src/main/java/net/runelite/http/api/loottracker/LootTrackerClient.java b/http-api/src/main/java/net/runelite/http/api/loottracker/LootTrackerClient.java index c6a52ea419..51b9329018 100644 --- a/http-api/src/main/java/net/runelite/http/api/loottracker/LootTrackerClient.java +++ b/http-api/src/main/java/net/runelite/http/api/loottracker/LootTrackerClient.java @@ -36,10 +36,10 @@ import java.util.UUID; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.runelite.http.api.RuneLiteAPI; +import static net.runelite.http.api.RuneLiteAPI.JSON; import okhttp3.Call; import okhttp3.Callback; import okhttp3.HttpUrl; -import okhttp3.MediaType; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; @@ -48,7 +48,6 @@ import okhttp3.Response; @AllArgsConstructor public class LootTrackerClient { - private static final MediaType JSON = MediaType.parse("application/json"); private static final Gson GSON = RuneLiteAPI.GSON; private final UUID uuid; diff --git a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java index 5176307511..5c6789ee4b 100644 --- a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java +++ b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java @@ -31,10 +31,10 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.util.List; import net.runelite.http.api.RuneLiteAPI; +import static net.runelite.http.api.RuneLiteAPI.JSON; import okhttp3.Call; import okhttp3.Callback; import okhttp3.HttpUrl; -import okhttp3.MediaType; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; @@ -43,8 +43,6 @@ import org.slf4j.LoggerFactory; public class XteaClient { - private static final MediaType JSON = MediaType.parse("application/json"); - private static final Logger logger = LoggerFactory.getLogger(XteaClient.class); public void submit(XteaRequest xteaRequest) diff --git a/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java b/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java index c9a3e40d3d..e57be2942b 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java @@ -164,7 +164,7 @@ public interface ChatColorConfig extends Config position = 45, keyName = "opaqueServerMessage", name = "Server message", - description = "Color of Server Messages (eg. 'Welcome to Runescape')" + description = "Color of Server Messages (eg. 'Welcome to RuneScape')" ) Color opaqueServerMessage(); @@ -404,7 +404,7 @@ public interface ChatColorConfig extends Config position = 75, keyName = "transparentServerMessage", name = "Server message (transparent)", - description = "Color of Server Messages (eg. 'Welcome to Runescape') (transparent)" + description = "Color of Server Messages (eg. 'Welcome to RuneScape') (transparent)" ) Color transparentServerMessage(); diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index 923d6fd7ce..24aaf2a66f 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -106,6 +106,8 @@ public enum ItemMapping ITEM_FURY_ORNAMENT_KIT(FURY_ORNAMENT_KIT, AMULET_OF_FURY_OR), ITEM_TORMENTED_BRACELET(TORMENTED_BRACELET, TORMENTED_BRACELET_OR), ITEM_TORMENTED_ORNAMENT_KIT(TORMENTED_ORNAMENT_KIT, TORMENTED_BRACELET_OR), + ITEM_BERSERKER_NECKLACE(BERSERKER_NECKLACE, BERSERKER_NECKLACE_OR), + ITEM_BERSERKER_NECKLACE_ORNAMENT_KIT(BERSERKER_NECKLACE_ORNAMENT_KIT, BERSERKER_NECKLACE_OR), // Ensouled heads ITEM_ENSOULED_GOBLIN_HEAD(ENSOULED_GOBLIN_HEAD_13448, ENSOULED_GOBLIN_HEAD), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java index cab68bdab6..c1f8711ac7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java @@ -599,9 +599,11 @@ public class TabInterface chatboxPanelManager.close(); } - if (event.getIdentifier() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + if ((event.getIdentifier() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + || event.getIdentifier() == WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getId()) && event.getMenuOpcode() == MenuOpcode.EXAMINE_ITEM_BANK_EQ - && event.getOption().equalsIgnoreCase("withdraw-x")) + && (event.getOption().equalsIgnoreCase("withdraw-x") + || event.getOption().equalsIgnoreCase("deposit-x"))) { waitSearchTick = true; rememberedSearch = client.getVar(VarClientStr.INPUT_TEXT); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index d563c0c0de..ced104cc30 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -144,7 +144,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll new SkillChallengeClue("Craft multiple cosmic runes from a single essence.", item(ItemID.PURE_ESSENCE)), new SkillChallengeClue("Plant a watermelon seed.", item(ItemID.RAKE), item(ItemID.SEED_DIBBER), xOfItem(ItemID.WATERMELON_SEED, 3)), new SkillChallengeClue("Activate the Chivalry prayer."), - new SkillChallengeClue("Hand in a Tier 2 or higher set of Shayzien supply armour", "hand in a boxed set of shayzien supply armour at tier 2 or above.", any("Shayzien Supply Set (Tier 2 or higher)", item(ItemID.SHAYZIEN_SUPPLY_SET_2), item(ItemID.SHAYZIEN_SUPPLY_SET_3), item(ItemID.SHAYZIEN_SUPPLY_SET_4), item(ItemID.SHAYZIEN_SUPPLY_SET_5))), + new SkillChallengeClue("Hand in a Tier 2 or higher set of Shayzien supply armour", "take the lovakengj armourers a boxed set of shayzien supply armour at tier 2 or above.", any("Shayzien Supply Set (Tier 2 or higher)", item(ItemID.SHAYZIEN_SUPPLY_SET_2), item(ItemID.SHAYZIEN_SUPPLY_SET_3), item(ItemID.SHAYZIEN_SUPPLY_SET_4), item(ItemID.SHAYZIEN_SUPPLY_SET_5))), // Master Sherlock Tasks new SkillChallengeClue("Equip an abyssal whip in front of the abyssal demons of the Slayer Tower.", true, any("Abyssal Whip", item(ItemID.ABYSSAL_WHIP), item(ItemID.FROZEN_ABYSSAL_WHIP), item(ItemID.VOLCANIC_ABYSSAL_WHIP))), new SkillChallengeClue("Smith a runite med helm.", item(ItemID.HAMMER), item(ItemID.RUNITE_BAR)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java index 87414f0387..052fef03ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java @@ -38,7 +38,7 @@ import net.runelite.api.coords.WorldPoint; *

* These puzzles are established by having some way to test the distance from the solution via "warmth", where being * colder means one is farther away from the target, and being warmer means one is closer to it, with the goal being to - * reach the most warm value to discover the solution point. Hot-cold puzzles in Old School Runescape are implemented + * reach the most warm value to discover the solution point. Hot-cold puzzles in Old School RuneScape are implemented * with specific set of solution points, so this solver will filter from a provided set of possible solutions as new * signals of temperatures and temperature changes are provided. */ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/item/MultipleOfItemRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/item/MultipleOfItemRequirement.java index e6fd05a1dc..f5e5905ab8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/item/MultipleOfItemRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/item/MultipleOfItemRequirement.java @@ -48,11 +48,16 @@ public class MultipleOfItemRequirement implements ItemRequirement @Override public boolean fulfilledBy(Item[] items) { + int quantityFound = 0; for (Item item : items) { - if (item.getId() == itemId && item.getQuantity() >= quantity) + if (item.getId() == itemId) { - return true; + quantityFound += item.getQuantity(); + if (quantityFound >= quantity) + { + return true; + } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java index 96de9a63f8..b0ab7c0c94 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java @@ -99,7 +99,7 @@ import net.runelite.http.api.hiscore.Skill; @Singleton public class HiscorePanel extends PluginPanel { - /* The maximum allowed username length in runescape accounts */ + /* The maximum allowed username length in RuneScape accounts */ private static final int MAX_USERNAME_LENGTH = 12; /** @@ -344,7 +344,7 @@ public class HiscorePanel extends PluginPanel return; } - /* Runescape usernames can't be longer than 12 characters long */ + /* RuneScape usernames can't be longer than 12 characters long */ if (lookup.length() > MAX_USERNAME_LENGTH) { searchBar.setIcon(IconTextField.Icon.ERROR); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 183e1deee7..2c23510a81 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -426,13 +426,21 @@ public class MusicPlugin extends Plugin { { Widget handle = slider.getHandle(); - Widget[] siblings = handle.getParent().getChildren(); - if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle) + Widget parent = handle.getParent(); + if (parent == null) { continue; } - siblings[slider.getTrack().getIndex()] = null; - siblings[handle.getIndex()] = null; + else + { + Widget[] siblings = parent.getChildren(); + if (siblings == null || handle.getIndex() >= siblings.length || siblings[handle.getIndex()] != handle) + { + continue; + } + siblings[slider.getTrack().getIndex()] = null; + siblings[handle.getIndex()] = null; + } } Object[] init = icon.getOnLoadListener(); @@ -459,11 +467,19 @@ public class MusicPlugin extends Plugin Widget handle = slider.getHandle(); if (handle != null) { - Widget[] siblings = handle.getParent().getChildren(); - if (siblings.length < handle.getIndex() || siblings[handle.getIndex()] != handle) + Widget parent = handle.getParent(); + if (parent == null) { handle = null; } + else + { + Widget[] siblings = parent.getChildren(); + if (siblings == null || handle.getIndex() >= siblings.length || siblings[handle.getIndex()] != handle) + { + handle = null; + } + } } if (handle == null) { diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm index 73badbb543..354aa42e71 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm @@ -377,12 +377,17 @@ LABEL327: jump LABEL372 LABEL330: iload 7 + iload 12 ; Load the id of the messageNode + sconst "" ; Push a container for the timestamp + sconst "addTimestamp" ; Push event name + runelite_callback ; Invoke callback + pop_int ; Pop the id of the messageNode sconst "From " sload 1 sconst ":" sconst "privateChatSplitFrom" runelite_callback - join_string 3 + join_string 4 ; Add the timestamp to the message sload 0 iload 9 iload 10 @@ -401,12 +406,17 @@ LABEL330: jump LABEL407 LABEL351: iload 7 + iload 12 ; Load the id of the messageNode + sconst "" ; Push container for the timestamp + sconst "addTimestamp" ; Push event name + runelite_callback ; Invoke callback + pop_int ; Pop the id of the messageNode sconst "To " sload 1 sconst ":" sconst "privateChatSplitTo" runelite_callback - join_string 3 + join_string 4 ; Add the timestamp to the message sload 0 iload 9 iload 10 @@ -425,7 +435,13 @@ LABEL351: jump LABEL407 LABEL372: iload 7 - sload 0 + iload 12 ; Load the id of the messageNode + sconst "" ; Push a container for the timestamp + sconst "addTimestamp" ; Push event name + runelite_callback ; Invoke callback + pop_int ; Pop the id of the messageNode + sload 0 ; Load the log in/out message + join_string 2 ; Add the timestamp to the message iload 9 iload 10 iconst 10682368