From cb131029ec91a7da22b0b00d6ceaf7536670f6dd Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 16 Dec 2019 14:55:31 -0500 Subject: [PATCH] woodcutting: account for plane change with despawn events the server only sends a despawn event when the actual object does despawn or when you change to that objects level and the server sends it to sync you with that planes objects. By setting the current player plane on gametick and checking that against the despawned objects plane, and only processing events where they match we can gurantee that the actual object has just despawned instead of the server sending the event just to resync the player with the current status of the location they just entered --- .../client/plugins/woodcutting/WoodcuttingPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java index 1078381bf4..b1d6544899 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java @@ -103,6 +103,7 @@ public class WoodcuttingPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private final List respawns = new ArrayList<>(); private boolean recentlyLoggedIn; + private int currentPlane; @Provides WoodcuttingConfig getConfig(ConfigManager configManager) @@ -144,6 +145,7 @@ public class WoodcuttingPlugin extends Plugin public void onGameTick(GameTick gameTick) { recentlyLoggedIn = false; + currentPlane = client.getPlane(); respawns.removeIf(TreeRespawn::isExpired); @@ -204,7 +206,7 @@ public class WoodcuttingPlugin extends Plugin Tree tree = Tree.findTree(object.getId()); if (tree != null) { - if (tree.getRespawnTime() != null && !recentlyLoggedIn) + if (tree.getRespawnTime() != null && !recentlyLoggedIn && currentPlane == object.getPlane()) { Point max = object.getSceneMaxLocation(); Point min = object.getSceneMinLocation();