@@ -19,17 +19,6 @@ public interface SafeSpotConfig extends Config
|
|||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
keyName = "playerSafeSpots",
|
|
||||||
name = "Render for Players",
|
|
||||||
description = "Renders 1 way safe spots vs other players"
|
|
||||||
)
|
|
||||||
default boolean playerSafeSpots()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
position = 2,
|
|
||||||
keyName = "npcSafeSpots",
|
keyName = "npcSafeSpots",
|
||||||
name = "Render for NPCs",
|
name = "Render for NPCs",
|
||||||
description = "Renders 1 way safe spots vs NPCs"
|
description = "Renders 1 way safe spots vs NPCs"
|
||||||
@@ -40,7 +29,7 @@ public interface SafeSpotConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 3,
|
position = 2,
|
||||||
keyName = "tileColor",
|
keyName = "tileColor",
|
||||||
name = "Tile Color",
|
name = "Tile Color",
|
||||||
description = "Color of safe spot tile"
|
description = "Color of safe spot tile"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import net.runelite.api.Actor;
|
|||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.CollisionDataFlag;
|
import net.runelite.api.CollisionDataFlag;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.Player;
|
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import net.runelite.api.coords.WorldArea;
|
import net.runelite.api.coords.WorldArea;
|
||||||
@@ -38,10 +37,10 @@ import net.runelite.client.plugins.PluginType;
|
|||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "1 Way Safe Spots",
|
name = "NPC Safe Spots",
|
||||||
description = "Renders tile overlays for one way safe spots",
|
description = "Renders tile overlays for one way safe spots",
|
||||||
tags = {"safe spot", "pvp", "safespots", "pklite"},
|
tags = {"safe spot", "safespots", "pvm"},
|
||||||
type = PluginType.UTILITY,
|
type = PluginType.PVM,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -71,7 +70,6 @@ public class SafeSpotPlugin extends Plugin
|
|||||||
private SafeSpotOverlay safeSpotOverlay;
|
private SafeSpotOverlay safeSpotOverlay;
|
||||||
private int tickCount = 0;
|
private int tickCount = 0;
|
||||||
|
|
||||||
private boolean playerSafeSpots;
|
|
||||||
private boolean npcSafeSpots;
|
private boolean npcSafeSpots;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private Color tileColor;
|
private Color tileColor;
|
||||||
@@ -113,7 +111,7 @@ public class SafeSpotPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.getTarget() == null && (this.npcSafeSpots || this.playerSafeSpots))
|
if (event.getTarget() == null && this.npcSafeSpots)
|
||||||
{
|
{
|
||||||
tickCount = 10;
|
tickCount = 10;
|
||||||
}
|
}
|
||||||
@@ -123,11 +121,6 @@ public class SafeSpotPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (client.getLocalPlayer().getInteracting() != null)
|
if (client.getLocalPlayer().getInteracting() != null)
|
||||||
{
|
{
|
||||||
if (client.getLocalPlayer().getInteracting() instanceof Player && this.playerSafeSpots)
|
|
||||||
{
|
|
||||||
safeSpotsRenderable = true;
|
|
||||||
updateSafeSpots();
|
|
||||||
}
|
|
||||||
if (client.getLocalPlayer().getInteracting() instanceof NPC && this.npcSafeSpots)
|
if (client.getLocalPlayer().getInteracting() instanceof NPC && this.npcSafeSpots)
|
||||||
{
|
{
|
||||||
if (npcManager.getStats(((NPC) client.getLocalPlayer().getInteracting()).getId()) != null)
|
if (npcManager.getStats(((NPC) client.getLocalPlayer().getInteracting()).getId()) != null)
|
||||||
@@ -215,7 +208,6 @@ public class SafeSpotPlugin extends Plugin
|
|||||||
|
|
||||||
private void updateConfig()
|
private void updateConfig()
|
||||||
{
|
{
|
||||||
this.playerSafeSpots = config.playerSafeSpots();
|
|
||||||
this.npcSafeSpots = config.npcSafeSpots();
|
this.npcSafeSpots = config.npcSafeSpots();
|
||||||
this.tileColor = config.tileColor();
|
this.tileColor = config.tileColor();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user