From a9200869327b2330eafa8c659eb1f3024c8c483d Mon Sep 17 00:00:00 2001 From: Benjamin Z Date: Thu, 25 Jan 2024 13:01:02 -0500 Subject: [PATCH] Updated for newest runelite release (#101) Co-authored-by: Benjamin Zeigler --- build.gradle | 2 +- .../clueitems/EmoteClueItemsPlugin.java | 2 -- .../runelite/clueitems/data/EmoteClue.java | 6 ++++++ .../runelite/clueitems/data/StashUnit.java | 2 -- .../clueitems/map/StashUnitWorldMapMarker.java | 2 -- .../runelite/clueitems/map/WorldMapMarker.java | 2 -- .../runelite/clueitems/map/WorldMapOrb.java | 18 +++++++++--------- .../clueitems/progress/ProgressManager.java | 18 +++++++++++------- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index d807887..475bfa2 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ repositories { mavenCentral() } -def runeLiteVersion = '1.10.4' +def runeLiteVersion = 'latest.release' dependencies { compileOnly group: 'net.runelite', name: 'client', version: runeLiteVersion diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/EmoteClueItemsPlugin.java b/src/main/java/com/larsvansoest/runelite/clueitems/EmoteClueItemsPlugin.java index eded4b2..4c68031 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/EmoteClueItemsPlugin.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/EmoteClueItemsPlugin.java @@ -29,7 +29,6 @@ package com.larsvansoest.runelite.clueitems; import com.google.inject.Provides; -import com.larsvansoest.runelite.clueitems.data.EmoteClueItem; import com.larsvansoest.runelite.clueitems.data.StashUnit; import com.larsvansoest.runelite.clueitems.map.StashUnitWorldMapMarker; import com.larsvansoest.runelite.clueitems.overlay.EmoteClueItemsOverlay; @@ -38,7 +37,6 @@ import com.larsvansoest.runelite.clueitems.progress.ProgressManager; import com.larsvansoest.runelite.clueitems.ui.EmoteClueItemsPalette; import com.larsvansoest.runelite.clueitems.ui.EmoteClueItemsPanel; -import com.larsvansoest.runelite.clueitems.ui.components.StatusPanel; import lombok.extern.slf4j.Slf4j; import net.runelite.api.*; import net.runelite.api.events.*; diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/data/EmoteClue.java b/src/main/java/com/larsvansoest/runelite/clueitems/data/EmoteClue.java index 962ec0a..b6c5996 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/data/EmoteClue.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/data/EmoteClue.java @@ -30,6 +30,7 @@ import net.runelite.api.Varbits; import net.runelite.api.annotations.Varbit; import net.runelite.api.coords.WorldPoint; +import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; import net.runelite.client.plugins.cluescrolls.clues.Enemy; import net.runelite.client.plugins.cluescrolls.clues.LocationClueScroll; import net.runelite.client.plugins.cluescrolls.clues.emote.Emote; @@ -1312,4 +1313,9 @@ private EmoteClue( this.enemy = enemy; this.hasFirePit = hasFirePit; } + + @Override + public WorldPoint getLocation(ClueScrollPlugin plugin) { + return location; + } } \ No newline at end of file diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/data/StashUnit.java b/src/main/java/com/larsvansoest/runelite/clueitems/data/StashUnit.java index ef57e3c..7b02b4d 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/data/StashUnit.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/data/StashUnit.java @@ -4,8 +4,6 @@ import lombok.RequiredArgsConstructor; import net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit; -import java.util.Arrays; - /** * Contains and wraps all {@link net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit} used by {@link net.runelite.client.plugins.cluescrolls.clues.EmoteClue}, integrated in vendored {@link com.larsvansoest.runelite.clueitems.data.EmoteClue} class. *

diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/map/StashUnitWorldMapMarker.java b/src/main/java/com/larsvansoest/runelite/clueitems/map/StashUnitWorldMapMarker.java index 688d5e3..7647b60 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/map/StashUnitWorldMapMarker.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/map/StashUnitWorldMapMarker.java @@ -2,8 +2,6 @@ import com.larsvansoest.runelite.clueitems.EmoteClueItemsImages; import com.larsvansoest.runelite.clueitems.data.StashUnit; -import net.runelite.api.coords.WorldPoint; -import net.runelite.http.api.worlds.WorldRegion; import java.awt.image.BufferedImage; diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapMarker.java b/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapMarker.java index a717b23..966192e 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapMarker.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapMarker.java @@ -1,13 +1,11 @@ package com.larsvansoest.runelite.clueitems.map; import com.larsvansoest.runelite.clueitems.EmoteClueItemsImages; -import com.larsvansoest.runelite.clueitems.data.StashUnit; import net.runelite.api.Client; import net.runelite.api.Point; import net.runelite.api.coords.WorldPoint; import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import java.awt.*; import java.awt.image.BufferedImage; public class WorldMapMarker extends WorldMapPoint diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapOrb.java b/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapOrb.java index 366d7f6..2accffe 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapOrb.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/map/WorldMapOrb.java @@ -1,17 +1,17 @@ package com.larsvansoest.runelite.clueitems.map; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; + import com.larsvansoest.runelite.clueitems.EmoteClueItemsImages; + import lombok.Getter; import lombok.Setter; import net.runelite.api.Client; import net.runelite.api.Point; -import net.runelite.api.RenderOverview; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetInfo; - -import java.awt.*; -import java.awt.image.BufferedImage; +import net.runelite.api.widgets.*; +import net.runelite.api.worldmap.WorldMap; public class WorldMapOrb { @@ -58,7 +58,7 @@ public WorldMapOrb(final WorldPoint worldPoint, final BufferedImage icon) private static Point mapWorldPointToGraphicsPoint(final Client client, final WorldPoint worldPoint) { - final RenderOverview ro = client.getRenderOverview(); + final WorldMap ro = client.getWorldMap(); if (!ro.getWorldMapData().surfaceContainsPosition(worldPoint.getX(), worldPoint.getY())) { @@ -67,7 +67,7 @@ private static Point mapWorldPointToGraphicsPoint(final Client client, final Wor final float pixelsPerTile = ro.getWorldMapZoom(); - final Widget map = client.getWidget(WidgetInfo.WORLD_MAP_VIEW); + final Widget map = client.getWidget(ComponentID.WORLD_MAP_MAPVIEW); if (map != null) { final Rectangle worldMapRect = map.getBounds(); @@ -100,7 +100,7 @@ private static Point mapWorldPointToGraphicsPoint(final Client client, final Wor private static Rectangle getWorldMapClipArea(final Client client) { - final Widget widget = client.getWidget(WidgetInfo.WORLD_MAP_VIEW); + final Widget widget = client.getWidget(ComponentID.WORLD_MAP_MAPVIEW); return widget == null ? null : widget.getBounds(); } diff --git a/src/main/java/com/larsvansoest/runelite/clueitems/progress/ProgressManager.java b/src/main/java/com/larsvansoest/runelite/clueitems/progress/ProgressManager.java index 76902b5..e542297 100644 --- a/src/main/java/com/larsvansoest/runelite/clueitems/progress/ProgressManager.java +++ b/src/main/java/com/larsvansoest/runelite/clueitems/progress/ProgressManager.java @@ -6,11 +6,8 @@ import com.larsvansoest.runelite.clueitems.data.EmoteClueItem; import com.larsvansoest.runelite.clueitems.data.StashUnit; import com.larsvansoest.runelite.clueitems.ui.components.StatusPanel; -import net.runelite.api.Client; -import net.runelite.api.InventoryID; -import net.runelite.api.Item; -import net.runelite.api.ItemContainer; -import net.runelite.api.vars.AccountType; + +import net.runelite.api.*; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.game.ItemManager; @@ -198,8 +195,15 @@ public List getUnopenedInterfaces() { unopenedContainers.add("equipment"); } - final AccountType accountType = this.client.getAccountType(); - if ((accountType == AccountType.GROUP_IRONMAN || accountType == AccountType.HARDCORE_GROUP_IRONMAN) && this.config.trackGroupStorage() && !this.inventoryMonitor.getHasSeenGroupStorage()) + + int accountType = this.client.getVarbitValue(Varbits.ACCOUNT_TYPE); + /* + * Varbits.ACCOUNT_TYPE + * 4 = group ironman + * 5 = hardcore group ironman + * 6 = unranked group ironman + */ + if ((accountType == 4 || accountType == 5 || accountType == 6) && this.config.trackGroupStorage() && !this.inventoryMonitor.getHasSeenGroupStorage()) { unopenedContainers.add("group storage"); }