From 9dd183838935fc0e6563fb8faa0d544c0017c8a0 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Tue, 31 Jul 2018 00:56:05 -0400 Subject: [PATCH] Deprecate useless getInstance() method, fixes #428 --- src/main/java/me/blackvein/quests/CustomObjective.java | 4 ++-- src/main/java/me/blackvein/quests/Quests.java | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/blackvein/quests/CustomObjective.java b/src/main/java/me/blackvein/quests/CustomObjective.java index ee2bad59a..cedf78ae6 100644 --- a/src/main/java/me/blackvein/quests/CustomObjective.java +++ b/src/main/java/me/blackvein/quests/CustomObjective.java @@ -131,9 +131,9 @@ public abstract class CustomObjective implements Listener { if (hasQuest && quester.hasCustomObjective(quest, obj.getName())) { if (quester.getQuestData(quest).customObjectiveCounts.containsKey(obj.getName())) { int old = quester.getQuestData(quest).customObjectiveCounts.get(obj.getName()); - plugin.getInstance().getQuester(player.getUniqueId()).getQuestData(quest).customObjectiveCounts.put(obj.getName(), old + count); + plugin.getQuester(player.getUniqueId()).getQuestData(quest).customObjectiveCounts.put(obj.getName(), old + count); } else { - plugin.getInstance().getQuester(player.getUniqueId()).getQuestData(quest).customObjectiveCounts.put(obj.getName(), count); + plugin.getQuester(player.getUniqueId()).getQuestData(quest).customObjectiveCounts.put(obj.getName(), count); } int index = -1; for (int i = 0; i < quester.getCurrentStage(quest).customObjectives.size(); i++) { diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index ea851bb0e..b854b4f92 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -446,7 +446,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } } - + + /** + * See Github issue #428 + * + * @deprecated Do not use this method! Will be removed in future release. + */ public Quests getInstance() { return this; }