diff --git a/cache/src/test/java/net/runelite/cache/CacheProperties.java b/cache/src/test/java/net/runelite/cache/CacheProperties.java index 50da8759dc..5614563f72 100644 --- a/cache/src/test/java/net/runelite/cache/CacheProperties.java +++ b/cache/src/test/java/net/runelite/cache/CacheProperties.java @@ -30,7 +30,7 @@ import java.util.Properties; public class CacheProperties { - private static Properties getProperies() throws IOException + private static Properties getProperties() throws IOException { Properties properties = new Properties(); InputStream resourceAsStream = StoreLocation.class.getResourceAsStream("/cache.properties"); @@ -40,11 +40,11 @@ public class CacheProperties public static int getRsVersion() throws IOException { - return Integer.parseInt(getProperies().getProperty("rs.version")); + return Integer.parseInt(getProperties().getProperty("rs.version")); } public static int getCacheVersion() throws IOException { - return Integer.parseInt(getProperies().getProperty("cache.version")); + return Integer.parseInt(getProperties().getProperty("cache.version")); } } diff --git a/cache/src/test/java/net/runelite/cache/MapDumperTest.java b/cache/src/test/java/net/runelite/cache/MapDumperTest.java index 70d20dcb0f..8d1fffd7cb 100644 --- a/cache/src/test/java/net/runelite/cache/MapDumperTest.java +++ b/cache/src/test/java/net/runelite/cache/MapDumperTest.java @@ -165,7 +165,7 @@ public class MapDumperTest @Test @Ignore - public void dunpJson() throws IOException + public void dumpJson() throws IOException { File base = StoreLocation.LOCATION, outDir = folder.newFolder(); diff --git a/http-api/src/main/java/net/runelite/http/api/account/AccountClient.java b/http-api/src/main/java/net/runelite/http/api/account/AccountClient.java index 3f66167367..0a286cd70e 100644 --- a/http-api/src/main/java/net/runelite/http/api/account/AccountClient.java +++ b/http-api/src/main/java/net/runelite/http/api/account/AccountClient.java @@ -96,7 +96,7 @@ public class AccountClient } } - public boolean sesssionCheck() + public boolean sessionCheck() { HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() .addPathSegment("account") diff --git a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java index 00af410588..4caef359c3 100644 --- a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java +++ b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java @@ -94,7 +94,7 @@ public class SessionManager // Check if session is still valid AccountClient accountClient = new AccountClient(session.getUuid()); - if (!accountClient.sesssionCheck()) + if (!accountClient.sessionCheck()) { log.debug("Loaded session {} is invalid", session.getUuid()); return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java index a343f49357..1289bf9dc4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java @@ -98,7 +98,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("HE DO POSE. IT IS CULTRRL, MK?", "Riki the sculptor's model", new WorldPoint(2904, 10206, 0), "East Keldagrim, south of kebab seller."), new AnagramClue("HEORIC", "Eohric", new WorldPoint(2900, 3565, 0), "Top floor of Burthorpe Castle", "36"), new AnagramClue("HIS PHOR", "Horphis", new WorldPoint(1639, 3812, 0), "Arceuus Library, Zeah", "1"), - new AnagramClue("I AM SIR", "Marisi", new WorldPoint(1813, 3488, 0), "Allotment patch, South coast Zeah", "5"), + new AnagramClue("I AM SIR", "Marisi", new WorldPoint(1737, 3557, 0), "Allotment patch, South of Hosidius chapel", "5"), new AnagramClue("ICY FE", "Fycie", new WorldPoint(2630, 2997, 0), "East Feldip Hills"), new AnagramClue("I DOOM ICON INN", "Dominic Onion", new WorldPoint(2609, 3116, 0), "Nightmare Zone", "9,500"), new AnagramClue("I EAT ITS CHART HINTS DO U", "Shiratti the Custodian", new WorldPoint(3427, 2927, 0), "North of fountain, Nardah"), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index 861958613b..0e73bd7f85 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -166,6 +166,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(3380, 3963, 0), "Wilderness. North of Volcano.") .put(new WorldPoint(3051, 3736, 0), "East of the Wilderness Obelisk in 28 Wilderness.") .put(new WorldPoint(2316, 3814, 0), "West of Neitiznot, near the bridge.") + .put(new WorldPoint(2872, 3937, 0), "Weiss.") // Master .put(new WorldPoint(2178, 3209, 0), "South of Elf Camp.") .put(new WorldPoint(2155, 3100, 0), "South of Port Tyras (BJS).") @@ -181,7 +182,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(3085, 3569, 0), "Wilderness. Obelisk of Air.") .put(new WorldPoint(2934, 2727, 0), "Eastern shore of Crash Island.") .put(new WorldPoint(1451, 3695, 0), "West side of Lizardman Canyon with Lizardman shaman.") - .put(new WorldPoint(2538, 3739, 0), "Waterbirth Island.") + .put(new WorldPoint(2538, 3739, 0), "Waterbirth Island. Bring a pet rock and rune thrownaxe.") .put(new WorldPoint(1698, 3792, 0), "Arceuus church.") .put(new WorldPoint(2951, 3820, 0), "Wilderness. Chaos Temple (level 38).") .put(new WorldPoint(2202, 3825, 0), "Pirates' Cove, between Lunar Isle and Rellekka.") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index 6a6c621f78..29bce7dc98 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -53,7 +53,7 @@ enum DiscordGameEventType TRAINING_COOKING(Skill.COOKING), TRAINING_WOODCUTTING(Skill.WOODCUTTING), TRAINING_FLETCHING(Skill.FLETCHING), - TRAINING_FISHING(Skill.FISHING), + TRAINING_FISHING(Skill.FISHING, 1), TRAINING_FIREMAKING(Skill.FIREMAKING), TRAINING_CRAFTING(Skill.CRAFTING), TRAINING_SMITHING(Skill.SMITHING), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java index 89c88345fa..56cf3bbedc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingListener.java @@ -107,7 +107,10 @@ class KeyRemappingListener extends MouseAdapter implements KeyListener } } - if (config.fkeyRemap()) + // In addition to the above checks, the F-key remapping shouldn't + // activate when dialogs are open which listen for number keys + // to select options + if (config.fkeyRemap() && !plugin.isDialogOpen()) { if (ONE.matches(e)) { @@ -188,23 +191,18 @@ class KeyRemappingListener extends MouseAdapter implements KeyListener switch (e.getKeyCode()) { case KeyEvent.VK_ENTER: + case KeyEvent.VK_ESCAPE: plugin.setTyping(false); clientThread.invoke(plugin::lockChat); break; - case KeyEvent.VK_ESCAPE: - plugin.setTyping(false); - clientThread.invoke(() -> - { - client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, ""); - plugin.lockChat(); - }); - break; case KeyEvent.VK_BACK_SPACE: + // Only lock chat on backspace when the typed text is now empty if (Strings.isNullOrEmpty(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT))) { plugin.setTyping(false); clientThread.invoke(plugin::lockChat); } + break; } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java index 62ef9a9241..54864fbc7a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/keyremapping/KeyRemappingPlugin.java @@ -135,6 +135,26 @@ public class KeyRemappingPlugin extends Plugin return true; } + /** + * Check if a dialog is open that will grab numerical input, to prevent F-key remapping + * from triggering. + * + * @return + */ + boolean isDialogOpen() + { + // Most chat dialogs with numerical input are added without the chatbox or its key listener being removed, + // so chatboxFocused() is true. The chatbox onkey script uses the following logic to ignore key presses, + // so we will use it too to not remap F-keys. + return isHidden(WidgetInfo.CHATBOX_MESSAGES) || isHidden(WidgetInfo.CHATBOX_TRANSPARENT_LINES); + } + + private boolean isHidden(WidgetInfo widgetInfo) + { + Widget w = client.getWidget(widgetInfo); + return w == null || w.isSelfHidden(); + } + @Subscribe public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent) { @@ -163,31 +183,25 @@ public class KeyRemappingPlugin extends Plugin void lockChat() { - Widget chatboxParent = client.getWidget(WidgetInfo.CHATBOX_PARENT); - if (chatboxParent != null && chatboxParent.getOnKeyListener() != null) + Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); + if (chatboxInput != null) { - Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); - if (chatboxInput != null) - { - chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT); - } + chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT); + // Typed text can be non-empty on plugin start, so clear it now + client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, ""); } } void unlockChat() { - Widget chatboxParent = client.getWidget(WidgetInfo.CHATBOX_PARENT); - if (chatboxParent != null) + Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); + if (chatboxInput != null) { - Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); - if (chatboxInput != null) + if (client.getGameState() == GameState.LOGGED_IN) { - if (client.getGameState() == GameState.LOGGED_IN) - { - final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1; - final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND; - chatboxInput.setText(getPlayerNameWithIcon() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor)); - } + final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1; + final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND; + chatboxInput.setText(getPlayerNameWithIcon() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor)); } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java index ce0d78308e..be9ae0b401 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java @@ -43,6 +43,8 @@ import static net.runelite.api.ObjectID.ROCKS_11374; import static net.runelite.api.ObjectID.ROCKS_11375; import static net.runelite.api.ObjectID.ROCKS_11376; import static net.runelite.api.ObjectID.ROCKS_11377; +import static net.runelite.api.ObjectID.ROCKS_11386; +import static net.runelite.api.ObjectID.ROCKS_11387; enum Rock { @@ -65,7 +67,9 @@ enum Rock } }, SILVER(Duration.ofMinutes(1), ROCKS_11369), + SANDSTONE(Duration.ofMillis(5400), ROCKS_11386), GOLD(Duration.ofMinutes(1), ROCKS_11370, ROCKS_11371), + GRANITE(Duration.ofMillis(5400), ROCKS_11387), MITHRIL(Duration.ofMinutes(2), ROCKS_11372, ROCKS_11373) { @Override diff --git a/runelite-client/src/main/scripts/CommandScript.rs2asm b/runelite-client/src/main/scripts/CommandScript.rs2asm index 0916a66d4a..930256d55e 100644 --- a/runelite-client/src/main/scripts/CommandScript.rs2asm +++ b/runelite-client/src/main/scripts/CommandScript.rs2asm @@ -322,8 +322,11 @@ LABEL241: iconst 0 ; sconst "blockChatInput" ; runelite_callback ; - if_icmpeq LABEL247 ; don't add to input varcstr + if_icmpeq SKIPSETVARC ; skip setting varc with input set_varc_string 335 + jump LABEL247 ; jump over SKIPSETVARC +SKIPSETVARC: + pop_string ; pop message LABEL247: invoke 223 return diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSTileMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSTileMixin.java index 093fa17d88..1cb4a729a8 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSTileMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSTileMixin.java @@ -76,6 +76,9 @@ public abstract class RSTileMixin implements RSTile @Shadow("clientInstance") private static RSClient client; + @Inject + private static RSGameObject lastGameObject; + @Inject private static RSDeque[][][] lastGroundItems = new RSDeque[Constants.MAX_Z][Constants.SCENE_SIZE][Constants.SCENE_SIZE]; @@ -234,12 +237,26 @@ public abstract class RSTileMixin implements RSTile // Update previous object to current previousGameObjects[idx] = current; + // Last game object + RSGameObject last = lastGameObject; + + // Update last game object + lastGameObject = current; + // Duplicate event, return if (current == previous) { return; } + if (current != null && current == last) + { + // When >1 tile objects are added to the scene, the same GameObject is added to + // multiple tiles. We keep lastGameObject to prevent duplicate spawn events from + // firing for these objects. + return; + } + // actors, projectiles, and graphics objects are added and removed from the scene each frame as GameObjects, // so ignore them. boolean currentInvalid = false, prevInvalid = false;