Clarify Stage variable for kill location names

This commit is contained in:
BuildTools 2019-01-27 23:24:01 -05:00
parent 5c734afcaf
commit f6f7bfc5eb
4 changed files with 24 additions and 10 deletions

View File

@ -1587,7 +1587,7 @@ public class QuestFactory implements ConversationAbandonedListener {
}
cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs);
cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, stage.radiiToKillWithin);
cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, stage.areaNames);
cc.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_NAMES, stage.killNames);
}
}
if (stage.locationsToReach.isEmpty() == false) {

View File

@ -675,7 +675,7 @@ public class Quester {
} else {
String obj = Lang.get(getPlayer(), "killAtLocation");
obj = obj.replace("<mob>", ChatColor.LIGHT_PURPLE + Quester.prettyMobString(e));
obj = obj.replace("<location>", getCurrentStage(quest).areaNames.get(getCurrentStage(quest).mobsToKill.indexOf(e)));
obj = obj.replace("<location>", getCurrentStage(quest).killNames.get(getCurrentStage(quest).mobsToKill.indexOf(e)));
unfinishedObjectives.add(ChatColor.GREEN + obj + ChatColor.GREEN + ": "
+ (getQuestData(quest).mobNumKilled.get(getQuestData(quest).mobsKilled.indexOf(e2)))
+ "/" + (getCurrentStage(quest).mobNumToKill.get(getCurrentStage(quest).mobsToKill.indexOf(e))));
@ -689,7 +689,7 @@ public class Quester {
} else {
String obj = Lang.get(getPlayer(), "killAtLocation");
obj = obj.replace("<mob>", ChatColor.LIGHT_PURPLE + Quester.prettyMobString(e));
obj = obj.replace("<location>", getCurrentStage(quest).areaNames.get(getCurrentStage(quest).mobsToKill.indexOf(e)));
obj = obj.replace("<location>", getCurrentStage(quest).killNames.get(getCurrentStage(quest).mobsToKill.indexOf(e)));
finishedObjectives.add(ChatColor.GRAY + obj + ChatColor.GRAY + ": "
+ (getQuestData(quest).mobNumKilled.get(getQuestData(quest).mobsKilled.indexOf(e2)))
+ "/" + (getCurrentStage(quest).mobNumToKill.get(getCurrentStage(quest).mobsToKill.indexOf(e))));

View File

@ -1750,7 +1750,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
oStage.mobNumToKill = mobNumToKill;
oStage.locationsToKillWithin = locationsToKillWithin;
oStage.radiiToKillWithin = radiiToKillWithin;
oStage.areaNames = areaNames;
oStage.killNames = areaNames;
Map<Map<Enchantment, Material>, Integer> enchants = new HashMap<Map<Enchantment, Material>, Integer>();
for (Enchantment e : enchantments) {
Map<Enchantment, Material> map = new HashMap<Enchantment, Material>();

View File

@ -100,7 +100,7 @@ public class Stage {
protected LinkedList<Integer> mobNumToKill = new LinkedList<Integer>();
protected LinkedList<Location> locationsToKillWithin = new LinkedList<Location>();
protected LinkedList<Integer> radiiToKillWithin = new LinkedList<Integer>();
protected LinkedList<String> areaNames = new LinkedList<String>();
protected LinkedList<String> killNames = new LinkedList<String>();
protected LinkedList<Location> locationsToReach = new LinkedList<Location>();
protected LinkedList<Integer> radiiToReachWithin = new LinkedList<Integer>();
protected LinkedList<World> worldsToReachWithin = new LinkedList<World>();
@ -271,12 +271,26 @@ public class Stage {
this.radiiToKillWithin = radiiToKillWithin;
}
public LinkedList<String> getAreaNames() {
return areaNames;
public LinkedList<String> getKillNames() {
return killNames;
}
public void setAreaNames(LinkedList<String> areaNames) {
this.areaNames = areaNames;
public void setKillNames(LinkedList<String> killNames) {
this.killNames = killNames;
}
/**
* @deprecated use getKillNames()
*/
public LinkedList<String> getAreaNames() {
return killNames;
}
/**
* @deprecated use setKillNames()
*/
public void setAreaNames(LinkedList<String> killNames) {
this.killNames = killNames;
}
public LinkedList<Location> getLocationsToReach() {