Make ObjectClueScroll extend LocationClueScroll

To force requirement of having location for every object ID, make object
clue scrolls always extend location clue scrolls.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-04-22 04:35:38 +02:00
parent d45066d38a
commit 58331a6c3b
4 changed files with 21 additions and 23 deletions

View File

@@ -215,14 +215,13 @@ public class ClueScrollPlugin extends Plugin
if (clue instanceof ObjectClueScroll)
{
int objectId = ((ObjectClueScroll) clue).getObjectId();
final ObjectClueScroll objectClueScroll = (ObjectClueScroll) clue;
int objectId = objectClueScroll.getObjectId();
if (objectId != -1)
{
if (clue instanceof LocationClueScroll)
{
// Match object with location every time
final WorldPoint location = ((LocationClueScroll) clue).getLocation();
final WorldPoint location = objectClueScroll.getLocation();
if (location != null)
{
@@ -247,7 +246,6 @@ public class ClueScrollPlugin extends Plugin
}
}
}
}
if (clue instanceof EmoteClue)
{

View File

@@ -47,7 +47,7 @@ import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMA
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.SPADE_IMAGE;
@Getter
public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueScroll, ObjectClueScroll, LocationClueScroll
public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueScroll, ObjectClueScroll
{
private static final Set<CrypticClue> CLUES = ImmutableSet.of(
new CrypticClue("Show this to Sherlock.", "Sherlock", new WorldPoint(2733, 3415, 0), "Sherlock is located to the east of the Sorcerer's tower in Seers' Village."),

View File

@@ -46,7 +46,7 @@ import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.PanelComponent;
@Getter
public class MapClue extends ClueScroll implements ObjectClueScroll, LocationClueScroll
public class MapClue extends ClueScroll implements ObjectClueScroll
{
private static final Set<MapClue> CLUES = ImmutableSet.of(
new MapClue(CLUE_SCROLL_EASY_12179, new WorldPoint(3300, 3291, 0)),

View File

@@ -24,7 +24,7 @@
*/
package net.runelite.client.plugins.cluescrolls.clues;
public interface ObjectClueScroll
public interface ObjectClueScroll extends LocationClueScroll
{
int getObjectId();
}