fishingspot: don't expose spots map
This commit is contained in:
@@ -217,7 +217,7 @@ public class FishingPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
final NPC npc = (NPC) target;
|
final NPC npc = (NPC) target;
|
||||||
FishingSpot spot = FishingSpot.getSPOTS().get(npc.getId());
|
FishingSpot spot = FishingSpot.findSpot(npc.getId());
|
||||||
|
|
||||||
if (spot == null)
|
if (spot == null)
|
||||||
{
|
{
|
||||||
@@ -289,7 +289,7 @@ public class FishingPlugin extends Plugin
|
|||||||
|
|
||||||
for (NPC npc : fishingSpots)
|
for (NPC npc : fishingSpots)
|
||||||
{
|
{
|
||||||
if (FishingSpot.getSPOTS().get(npc.getId()) == FishingSpot.MINNOW && config.showMinnowOverlay())
|
if (FishingSpot.findSpot(npc.getId()) == FishingSpot.MINNOW && config.showMinnowOverlay())
|
||||||
{
|
{
|
||||||
final int id = npc.getIndex();
|
final int id = npc.getIndex();
|
||||||
final MinnowSpot minnowSpot = minnowSpots.get(id);
|
final MinnowSpot minnowSpot = minnowSpots.get(id);
|
||||||
@@ -315,7 +315,7 @@ public class FishingPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
final NPC npc = event.getNpc();
|
final NPC npc = event.getNpc();
|
||||||
|
|
||||||
if (!FishingSpot.getSPOTS().containsKey(npc.getId()))
|
if (FishingSpot.findSpot(npc.getId()) == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ enum FishingSpot
|
|||||||
COMMON_TENCH("Common tench, Bluegill, Greater siren, Mottled eel", ItemID.COMMON_TENCH,
|
COMMON_TENCH("Common tench, Bluegill, Greater siren, Mottled eel", ItemID.COMMON_TENCH,
|
||||||
FISHING_SPOT_8523);
|
FISHING_SPOT_8523);
|
||||||
|
|
||||||
@Getter
|
|
||||||
private static final Map<Integer, FishingSpot> SPOTS;
|
private static final Map<Integer, FishingSpot> SPOTS;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
@@ -200,4 +199,9 @@ enum FishingSpot
|
|||||||
this.fishSpriteId = fishSpriteId;
|
this.fishSpriteId = fishSpriteId;
|
||||||
this.ids = ids;
|
this.ids = ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static FishingSpot findSpot(int id)
|
||||||
|
{
|
||||||
|
return SPOTS.get(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class FishingSpotMinimapOverlay extends Overlay
|
|||||||
|
|
||||||
for (NPC npc : plugin.getFishingSpots())
|
for (NPC npc : plugin.getFishingSpots())
|
||||||
{
|
{
|
||||||
FishingSpot spot = FishingSpot.getSPOTS().get(npc.getId());
|
FishingSpot spot = FishingSpot.findSpot(npc.getId());
|
||||||
|
|
||||||
if (spot == null)
|
if (spot == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class FishingSpotOverlay extends Overlay
|
|||||||
WorldPoint previousLocation = null;
|
WorldPoint previousLocation = null;
|
||||||
for (NPC npc : plugin.getFishingSpots())
|
for (NPC npc : plugin.getFishingSpots())
|
||||||
{
|
{
|
||||||
FishingSpot spot = FishingSpot.getSPOTS().get(npc.getId());
|
FishingSpot spot = FishingSpot.findSpot(npc.getId());
|
||||||
|
|
||||||
if (spot == null)
|
if (spot == null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user