diff --git a/src/main/java/me/blackvein/quests/CustomObjective.java b/src/main/java/me/blackvein/quests/CustomObjective.java index e8a3580ac..3e82bbb2c 100644 --- a/src/main/java/me/blackvein/quests/CustomObjective.java +++ b/src/main/java/me/blackvein/quests/CustomObjective.java @@ -27,7 +27,6 @@ public abstract class CustomObjective implements Listener { private Map descriptions = new HashMap(); private String countPrompt = "null"; private String display = "null"; - private boolean enableCount = true; private boolean showCount = true; private int count = 1; @@ -116,15 +115,35 @@ public abstract class CustomObjective implements Listener { public void setCountPrompt(String countPrompt) { this.countPrompt = countPrompt; } - - public boolean isCountShown() { + + /** + * Check whether to let user set required amount for objective + * + * @param enableCount + */ + public boolean canShowCount() { return showCount; } + /** + * Set whether to let user set required amount for objective + * + * @param enableCount + */ public void setShowCount(boolean showCount) { this.showCount = showCount; } + /** + * Check whether to let user set required amount for objective + * + * @param enableCount + * @deprecated use setShowCount(boolean) + */ + public void setEnableCount(boolean enableCount) { + setShowCount(enableCount); + } + public String getDisplay() { return display; } @@ -132,14 +151,6 @@ public abstract class CustomObjective implements Listener { public void setDisplay(String display) { this.display = display; } - - public boolean isEnableCount() { - return enableCount; - } - - public void setEnableCount(boolean enableCount) { - this.enableCount = enableCount; - } public Map getDataForPlayer(Player player, CustomObjective customObj, Quest quest) { return getDatamap(player, customObj, quest); @@ -246,9 +257,6 @@ public abstract class CustomObjective implements Listener { if (other.display.equals(display) == false) { return false; } - if (other.enableCount != enableCount) { - return false; - } if (other.showCount != showCount) { return false; } diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index 1da62d302..9018ea28c 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -796,12 +796,12 @@ public class Quester { } } if (entry.getValue() < getCurrentStage(quest).customObjectiveCounts.get(index)) { - if (co.isCountShown() && co.isEnableCount()) { + if (co.canShowCount()) { display = display.replace("%count%", entry.getValue() + "/" + getCurrentStage(quest).customObjectiveCounts.get(index)); } unfinishedObjectives.add(ChatColor.GREEN + display); } else { - if (co.isCountShown() && co.isEnableCount()) { + if (co.canShowCount()) { display = display.replace("%count%", getCurrentStage(quest).customObjectiveCounts.get(index) + "/" + getCurrentStage(quest).customObjectiveCounts.get(index)); } finishedObjectives.add(ChatColor.GRAY + display); @@ -1554,7 +1554,7 @@ public class Quester { for (String key : co.getData().keySet()) { message = message.replace("%" + ((String) key) + "%", (String) datamap.get(key)); } - if (co.isCountShown() && co.isEnableCount()) { + if (co.canShowCount()) { message = message.replace("%count%", getCurrentStage(quest).customObjectiveCounts.get(index) + "/" + getCurrentStage(quest).customObjectiveCounts.get(index)); } p.sendMessage(message); diff --git a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java index 4f6506248..e178cf522 100644 --- a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java @@ -3895,7 +3895,7 @@ public class CreateStagePrompt extends FixedSetPrompt { context.setSessionData(pref + CK.S_CUSTOM_OBJECTIVES_COUNT, countList); } // Send user to the count prompt / custom data prompt if there is any needed - if (found.isEnableCount()) { + if (found.canShowCount()) { return new CustomObjectiveCountPrompt(); } if (found.getData().isEmpty() == false) {