Clear game objects on plugin shutdown
As we receive new events from RegionTileManager now, properly clear all cached game objects on plugin's shutdown
This commit is contained in:
@@ -62,6 +62,12 @@ public class AgilityPlugin extends Plugin
|
|||||||
@Getter
|
@Getter
|
||||||
private AgilityOverlay overlay;
|
private AgilityOverlay overlay;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
obstacles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure(Binder binder)
|
public void configure(Binder binder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -91,6 +91,13 @@ public class BarrowsPlugin extends Plugin
|
|||||||
return barrowsOverlay;
|
return barrowsOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown()
|
||||||
|
{
|
||||||
|
walls.clear();
|
||||||
|
ladders.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWallObjectSpanwed(WallObjectSpawned event)
|
public void onWallObjectSpanwed(WallObjectSpawned event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ public class BlastFurnacePlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private ConveyorBeltOverlay conveyorBeltOverlay;
|
private ConveyorBeltOverlay conveyorBeltOverlay;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown()
|
||||||
|
{
|
||||||
|
conveyorBelt = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BlastFurnaceConfig provideConfig(ConfigManager configManager)
|
BlastFurnaceConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,6 +93,14 @@ public class CannonPlugin extends Plugin
|
|||||||
return cannonOverlay;
|
return cannonOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
cannonPlaced = false;
|
||||||
|
myCannon = null;
|
||||||
|
cballsLeft = 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ import net.runelite.api.GameState;
|
|||||||
import net.runelite.api.ObjectID;
|
import net.runelite.api.ObjectID;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.queries.GameObjectQuery;
|
|
||||||
import net.runelite.api.queries.PlayerQuery;
|
|
||||||
import net.runelite.client.config.ConfigManager;
|
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
|
import net.runelite.api.queries.GameObjectQuery;
|
||||||
|
import net.runelite.api.queries.PlayerQuery;
|
||||||
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.task.Schedule;
|
import net.runelite.client.task.Schedule;
|
||||||
@@ -103,6 +103,15 @@ public class HunterPlugin extends Plugin
|
|||||||
return Arrays.asList(trapOverlay, catchrateOverlay);
|
return Arrays.asList(trapOverlay, catchrateOverlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
catchAtempts = 0;
|
||||||
|
catchSuccess = 0;
|
||||||
|
lastActionTime = Instant.ofEpochMilli(0);
|
||||||
|
traps.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -109,6 +109,13 @@ public class MotherlodePlugin extends Plugin
|
|||||||
return Arrays.asList(overlay, rocksOverlay, motherlodeSackOverlay);
|
return Arrays.asList(overlay, rocksOverlay, motherlodeSackOverlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
veins.clear();
|
||||||
|
rocks.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public MotherlodeSession getSession()
|
public MotherlodeSession getSession()
|
||||||
{
|
{
|
||||||
return session;
|
return session;
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ public class PohPlugin extends Plugin
|
|||||||
overlay.updateConfig();
|
overlay.updateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
pohObjects.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void updateConfig(ConfigChanged event)
|
public void updateConfig(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,14 @@ public class RoguesDenPlugin extends Plugin
|
|||||||
@Getter
|
@Getter
|
||||||
private RoguesDenOverlay overlay;
|
private RoguesDenOverlay overlay;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown()
|
||||||
|
{
|
||||||
|
obstaclesHull.clear();
|
||||||
|
obstaclesTile.clear();
|
||||||
|
hasGem = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure(Binder binder)
|
public void configure(Binder binder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -92,6 +92,12 @@ public class RunecraftPlugin extends Plugin
|
|||||||
abyssOverlay.updateConfig();
|
abyssOverlay.updateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
|
abyssObjects.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void updateConfig(ConfigChanged event)
|
public void updateConfig(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user