Target delivery NPCs for compass and GPS, fixes #610

This commit is contained in:
BuildTools 2019-01-04 03:16:38 -05:00
parent fc15de9172
commit 32b6cab5e6

View File

@ -258,6 +258,11 @@ public class Quest {
} }
} else if (stage.locationsToReach != null && stage.locationsToReach.size() > 0) { } else if (stage.locationsToReach != null && stage.locationsToReach.size() > 0) {
targetLocations.addAll(stage.locationsToReach); targetLocations.addAll(stage.locationsToReach);
} else if (stage.itemDeliveryTargets != null && stage.itemDeliveryTargets.size() > 0) {
for (Integer i : stage.itemDeliveryTargets) {
NPC npc = Quests.citizens.getNPCRegistry().getById(i);
targetLocations.add(npc.getStoredLocation());
}
} }
if (targetLocations != null && !targetLocations.isEmpty()) { if (targetLocations != null && !targetLocations.isEmpty()) {
int index = 1; int index = 1;
@ -305,6 +310,9 @@ public class Quest {
targetLocation = plugin.getNPCLocation(nextStage.citizensToKill.getFirst()); targetLocation = plugin.getNPCLocation(nextStage.citizensToKill.getFirst());
} else if (nextStage.locationsToReach != null && nextStage.locationsToReach.size() > 0) { } else if (nextStage.locationsToReach != null && nextStage.locationsToReach.size() > 0) {
targetLocation = nextStage.locationsToReach.getFirst(); targetLocation = nextStage.locationsToReach.getFirst();
} else if (nextStage.itemDeliveryTargets != null && nextStage.itemDeliveryTargets.size() > 0) {
NPC npc = Quests.citizens.getNPCRegistry().getById(nextStage.itemDeliveryTargets.getFirst());
targetLocation = npc.getStoredLocation();
} }
if (targetLocation != null) { if (targetLocation != null) {
if (targetLocation.getWorld().getName().equals(quester.getPlayer().getWorld().getName())) { if (targetLocation.getWorld().getName().equals(quester.getPlayer().getWorld().getName())) {