Removes the quests changed check as it was unreliable

This commit is contained in:
Kristian Knarvik 2022-11-02 13:52:23 +01:00
parent df72d37b74
commit 61fc07f58d
2 changed files with 9 additions and 18 deletions

View File

@ -42,7 +42,7 @@ public class QuestStagesInfoGenerator {
int mobTypes = stage.getMobsToKill().size(); int mobTypes = stage.getMobsToKill().size();
for (int i = 0; i < mobTypes; i++) { for (int i = 0; i < mobTypes; i++) {
questInfo.append("<li>Kill ").append(QuestsHelper.normalizeName(stage.getMobsToKill().get(i).name())).append( questInfo.append("<li>Kill ").append(QuestsHelper.normalizeName(stage.getMobsToKill().get(i).name())).append(
" X ").append(stage.getMobNumToKill().get(i)).append("</li>"); " x ").append(stage.getMobNumToKill().get(i)).append("</li>");
} }
int deliveries = stage.getItemDeliveryTargets().size(); int deliveries = stage.getItemDeliveryTargets().size();
for (int i = 0; i < deliveries; i++) { for (int i = 0; i < deliveries; i++) {

View File

@ -18,7 +18,6 @@ import org.dynmap.markers.GenericMarker;
import org.dynmap.markers.MarkerIcon; import org.dynmap.markers.MarkerIcon;
import org.dynmap.markers.MarkerSet; import org.dynmap.markers.MarkerSet;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -35,7 +34,6 @@ public class QuestsHandler extends AbstractTraitHandler {
private MarkerSet questMarkerSet; private MarkerSet questMarkerSet;
private MarkerSet questAreaMarkerSet; private MarkerSet questAreaMarkerSet;
private Map<Icon, MarkerIcon> markerIcons; private Map<Icon, MarkerIcon> markerIcons;
private Collection<IQuest> loadedQuests;
private Map<UUID, NPCQuestInfo> questGiverInfo; private Map<UUID, NPCQuestInfo> questGiverInfo;
@Override @Override
@ -64,24 +62,17 @@ public class QuestsHandler extends AbstractTraitHandler {
return; return;
} }
//There is no point in updating if there has been no changes in quests //Remove old quest markers
boolean questsChanged = loadedQuests == null || !loadedQuests.equals(questsAPI.getLoadedQuests()); questMarkerSet.getMarkers().forEach(GenericMarker::deleteMarker);
loadedQuests = questsAPI.getLoadedQuests();
//Updates all quest area markers //Update all area markers for quests
if (questsChanged) { updateQuestAreas();
//Remove old quest markers
questMarkerSet.getMarkers().forEach(GenericMarker::deleteMarker);
//Update all area markers for quests
updateQuestAreas();
//Generate information about all NPCs involved in quests //Generate information about all NPCs involved in quests
generateQuestNPCInfo(); generateQuestNPCInfo();
//Generate markers based on the generated info //Generate markers based on the generated info
generateAllMarkers(); generateAllMarkers();
}
} }
/** /**