runecraft: remove unnecessary rifts set
This commit is contained in:
@@ -71,7 +71,7 @@ class AbyssMinimapOverlay extends Overlay
|
||||
for (DecorativeObject object : plugin.getAbyssObjects())
|
||||
{
|
||||
AbyssRifts rift = AbyssRifts.getRift(object.getId());
|
||||
if (rift == null || !plugin.getRifts().contains(rift))
|
||||
if (rift == null || !rift.getConfigEnabled().test(config))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ class AbyssOverlay extends Overlay
|
||||
private void renderRift(Graphics2D graphics, DecorativeObject object)
|
||||
{
|
||||
AbyssRifts rift = AbyssRifts.getRift(object.getId());
|
||||
if (rift == null || !plugin.getRifts().contains(rift))
|
||||
if (rift == null || !rift.getConfigEnabled().test(config))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.runecraft;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -52,7 +51,6 @@ import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.npcoverlay.HighlightedNpc;
|
||||
import net.runelite.client.game.npcoverlay.NpcOverlayService;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -77,9 +75,6 @@ public class RunecraftPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Set<DecorativeObject> abyssObjects = new HashSet<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Set<AbyssRifts> rifts = new HashSet<>();
|
||||
|
||||
private boolean degradedPouchInInventory;
|
||||
|
||||
@Inject
|
||||
@@ -114,7 +109,6 @@ public class RunecraftPlugin extends Plugin
|
||||
npcOverlayService.registerHighlighter(highlightDarkMage);
|
||||
overlayManager.add(abyssOverlay);
|
||||
overlayManager.add(abyssMinimapOverlay);
|
||||
updateRifts();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,15 +121,6 @@ public class RunecraftPlugin extends Plugin
|
||||
degradedPouchInInventory = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(RunecraftConfig.GROUP))
|
||||
{
|
||||
updateRifts();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
{
|
||||
@@ -205,12 +190,4 @@ public class RunecraftPlugin extends Plugin
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void updateRifts()
|
||||
{
|
||||
rifts.clear();
|
||||
Arrays.stream(AbyssRifts.values())
|
||||
.filter(r -> r.getConfigEnabled().test(config))
|
||||
.forEach(rifts::add);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user