diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index dfeb80a21..986d18dc2 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -528,6 +528,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener Class requirementClass = c.asSubclass(CustomRequirement.class); Constructor cstrctr = requirementClass.getConstructor(); CustomRequirement requirement = cstrctr.newInstance(); + if (customRequirements.contains(requirement)) { + customRequirements.remove(requirement); + } customRequirements.add(requirement); String name = requirement.getName() == null ? "[" + jar.getName() + "]" : requirement.getName(); String author = requirement.getAuthor() == null ? "[Unknown]" : requirement.getAuthor(); @@ -537,6 +540,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener Class rewardClass = c.asSubclass(CustomReward.class); Constructor cstrctr = rewardClass.getConstructor(); CustomReward reward = cstrctr.newInstance(); + if (customRewards.contains(reward)) { + customRewards.remove(reward); + } customRewards.add(reward); String name = reward.getName() == null ? "[" + jar.getName() + "]" : reward.getName(); String author = reward.getAuthor() == null ? "[Unknown]" : reward.getAuthor(); @@ -546,6 +552,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener Class objectiveClass = c.asSubclass(CustomObjective.class); Constructor cstrctr = objectiveClass.getConstructor(); CustomObjective objective = cstrctr.newInstance(); + if (customObjectives.contains(objective)) { + customObjectives.remove(objective); + } customObjectives.add(objective); String name = objective.getName() == null ? "[" + jar.getName() + "]" : objective.getName(); String author = objective.getAuthor() == null ? "[Unknown]" : objective.getAuthor();