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
|
||||
private AgilityOverlay overlay;
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
obstacles.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder)
|
||||
{
|
||||
|
||||
@@ -91,6 +91,13 @@ public class BarrowsPlugin extends Plugin
|
||||
return barrowsOverlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
walls.clear();
|
||||
ladders.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectSpanwed(WallObjectSpawned event)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,12 @@ public class BlastFurnacePlugin extends Plugin
|
||||
@Inject
|
||||
private ConveyorBeltOverlay conveyorBeltOverlay;
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
conveyorBelt = null;
|
||||
}
|
||||
|
||||
@Provides
|
||||
BlastFurnaceConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
|
||||
@@ -93,6 +93,14 @@ public class CannonPlugin extends Plugin
|
||||
return cannonOverlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
cannonPlaced = false;
|
||||
myCannon = null;
|
||||
cballsLeft = 0;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
|
||||
@@ -45,12 +45,12 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.ObjectID;
|
||||
import net.runelite.api.Player;
|
||||
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.GameObjectSpawned;
|
||||
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.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
@@ -103,6 +103,15 @@ public class HunterPlugin extends Plugin
|
||||
return Arrays.asList(trapOverlay, catchrateOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
catchAtempts = 0;
|
||||
catchSuccess = 0;
|
||||
lastActionTime = Instant.ofEpochMilli(0);
|
||||
traps.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
|
||||
@@ -109,6 +109,13 @@ public class MotherlodePlugin extends Plugin
|
||||
return Arrays.asList(overlay, rocksOverlay, motherlodeSackOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
veins.clear();
|
||||
rocks.clear();
|
||||
}
|
||||
|
||||
public MotherlodeSession getSession()
|
||||
{
|
||||
return session;
|
||||
|
||||
@@ -95,6 +95,12 @@ public class PohPlugin extends Plugin
|
||||
overlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
pohObjects.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void updateConfig(ConfigChanged event)
|
||||
{
|
||||
|
||||
@@ -73,6 +73,14 @@ public class RoguesDenPlugin extends Plugin
|
||||
@Getter
|
||||
private RoguesDenOverlay overlay;
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
obstaclesHull.clear();
|
||||
obstaclesTile.clear();
|
||||
hasGem = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder)
|
||||
{
|
||||
|
||||
@@ -92,6 +92,12 @@ public class RunecraftPlugin extends Plugin
|
||||
abyssOverlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
abyssObjects.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void updateConfig(ConfigChanged event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user