corp plugin: remove dark core attack deprioritization

Removed at Jagex's request
This commit is contained in:
Adam
2019-10-24 13:55:44 -04:00
parent 543ce78710
commit e2c72a6767
2 changed files with 0 additions and 43 deletions

View File

@@ -31,17 +31,6 @@ import net.runelite.client.config.ConfigItem;
@ConfigGroup("corp")
public interface CorpConfig extends Config
{
@ConfigItem(
keyName = "leftClickCore",
name = "Left click walk on core",
description = "Prioritizes Walk here over Attack on the Dark energy core",
position = 1
)
default boolean leftClickCore()
{
return true;
}
@ConfigItem(
keyName = "showDamage",
name = "Show damage overlay",

View File

@@ -35,16 +35,12 @@ import net.runelite.api.Actor;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.MenuAction;
import static net.runelite.api.MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET;
import net.runelite.api.MenuEntry;
import net.runelite.api.NPC;
import net.runelite.api.NpcID;
import net.runelite.api.Varbits;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.HitsplatApplied;
import net.runelite.api.events.InteractingChanged;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.NpcSpawned;
import net.runelite.client.chat.ChatColorType;
@@ -65,10 +61,6 @@ import net.runelite.client.ui.overlay.OverlayManager;
@Slf4j
public class CorpPlugin extends Plugin
{
private static final int NPC_SECTION_ACTION = MenuAction.NPC_SECOND_OPTION.getId();
private static final String ATTACK = "Attack";
private static final String DARK_ENERGY_CORE = "Dark energy core";
@Getter(AccessLevel.PACKAGE)
private NPC corp;
@@ -224,28 +216,4 @@ public class CorpPlugin extends Plugin
players.add(source);
}
@Subscribe
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
{
if (menuEntryAdded.getType() != NPC_SECTION_ACTION
|| !config.leftClickCore() || !menuEntryAdded.getOption().equals(ATTACK))
{
return;
}
final int npcIndex = menuEntryAdded.getIdentifier();
final NPC npc = client.getCachedNPCs()[npcIndex];
if (npc == null || !npc.getName().equals(DARK_ENERGY_CORE))
{
return;
}
// since this is the menu entry add event, this is the last menu entry
MenuEntry[] menuEntries = client.getMenuEntries();
MenuEntry menuEntry = menuEntries[menuEntries.length - 1];
menuEntry.setType(NPC_SECTION_ACTION + MENU_ACTION_DEPRIORITIZE_OFFSET);
client.setMenuEntries(menuEntries);
}
}