From 5a42226f1c169f745b9edf7a12f5b18b101c11cd Mon Sep 17 00:00:00 2001 From: Nathan Wolf Date: Sat, 24 Mar 2018 13:15:57 -0700 Subject: [PATCH] Release 1.1 to work with Quests 3.2.7 --- CHANGELOG.md | 4 ++++ pom.xml | 4 ++-- .../mine/bukkit/magicquests/AddSpellObjective.java | 7 ++++++- .../mine/bukkit/magicquests/CraftWandObjective.java | 6 +++++- .../mine/bukkit/magicquests/MagicMobKillObjective.java | 7 ++++++- .../mine/bukkit/magicquests/SpellCastObjective.java | 8 ++++++-- .../mine/bukkit/magicquests/SpellUpgradeObjective.java | 6 +++++- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 623baab..ae1917b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +# 1.1 + + - Updated to work with Quests 3.2.7 and up + # 1.0 - First release, Magic/Quests integration module. diff --git a/pom.xml b/pom.xml index 190a6c3..2d3fa04 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.elmakers.mine.bukkit.plugins MagicQuests - 1.1-SNAPSHOT + 1.1 Magic Quests http://mine.elmakers.com @@ -61,7 +61,7 @@ me.blackvein.quests quests - 2.5.3 + 3.2.8 provided diff --git a/src/main/java/com/elmakers/mine/bukkit/magicquests/AddSpellObjective.java b/src/main/java/com/elmakers/mine/bukkit/magicquests/AddSpellObjective.java index 0fd1b81..76afb28 100644 --- a/src/main/java/com/elmakers/mine/bukkit/magicquests/AddSpellObjective.java +++ b/src/main/java/com/elmakers/mine/bukkit/magicquests/AddSpellObjective.java @@ -8,6 +8,8 @@ import me.blackvein.quests.Quest; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; + +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -15,6 +17,9 @@ import java.util.Map; public class AddSpellObjective extends CustomObjective { + // .... why did Quests.getInstance need to be made non-static.. ?? + private static Quests quests = (Quests) Bukkit.getServer().getPluginManager().getPlugin("Quests"); + public AddSpellObjective() { this.setName("Add Magic Spell"); @@ -36,7 +41,7 @@ public void onAddSpell(AddSpellEvent event) { // This fails in a pretty bad way if the player is not on a quest currently // There isn't a super clean way to check for this state so we'll just catch // and ignore expections :\ - Quester quester = Quests.getInstance().getQuester(player.getUniqueId()); + Quester quester = quests.getQuester(player.getUniqueId()); if (quester == null) { return; } diff --git a/src/main/java/com/elmakers/mine/bukkit/magicquests/CraftWandObjective.java b/src/main/java/com/elmakers/mine/bukkit/magicquests/CraftWandObjective.java index 8f68fcc..d953e04 100644 --- a/src/main/java/com/elmakers/mine/bukkit/magicquests/CraftWandObjective.java +++ b/src/main/java/com/elmakers/mine/bukkit/magicquests/CraftWandObjective.java @@ -7,6 +7,8 @@ import me.blackvein.quests.Quest; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; + +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,6 +16,8 @@ import java.util.Map; public class CraftWandObjective extends CustomObjective { + // .... why did Quests.getInstance need to be made non-static.. ?? + private static Quests quests = (Quests) Bukkit.getServer().getPluginManager().getPlugin("Quests"); public CraftWandObjective() { this.setName("Craft Magic Wand"); @@ -37,7 +41,7 @@ public void onCraftWand(CraftWandEvent event) { // This fails in a pretty bad way if the player is not on a quest currently // There isn't a super clean way to check for this state so we'll just catch // and ignore expections :\ - Quester quester = Quests.getInstance().getQuester(player.getUniqueId()); + Quester quester = quests.getQuester(player.getUniqueId()); if (quester == null) { return; } diff --git a/src/main/java/com/elmakers/mine/bukkit/magicquests/MagicMobKillObjective.java b/src/main/java/com/elmakers/mine/bukkit/magicquests/MagicMobKillObjective.java index c2c9b43..9168cb3 100644 --- a/src/main/java/com/elmakers/mine/bukkit/magicquests/MagicMobKillObjective.java +++ b/src/main/java/com/elmakers/mine/bukkit/magicquests/MagicMobKillObjective.java @@ -7,6 +7,8 @@ import me.blackvein.quests.Quest; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; + +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,6 +16,9 @@ import java.util.Map; public class MagicMobKillObjective extends CustomObjective { + // .... why did Quests.getInstance need to be made non-static.. ?? + private static Quests quests = (Quests) Bukkit.getServer().getPluginManager().getPlugin("Quests"); + public MagicMobKillObjective() { this.setName("Kill Magic Mob"); @@ -37,7 +42,7 @@ public void onMagicMobKill(MagicMobDeathEvent event) { // This fails in a pretty bad way if the player is not on a quest currently // There isn't a super clean way to check for this state so we'll just catch // and ignore expections :\ - Quester quester = Quests.getInstance().getQuester(player.getUniqueId()); + Quester quester = quests.getQuester(player.getUniqueId()); if (quester == null) { return; } diff --git a/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellCastObjective.java b/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellCastObjective.java index e1461e4..b2d2cd7 100644 --- a/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellCastObjective.java +++ b/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellCastObjective.java @@ -8,6 +8,8 @@ import me.blackvein.quests.Quest; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; + +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -15,6 +17,8 @@ import java.util.Map; public class SpellCastObjective extends CustomObjective { + // .... why did Quests.getInstance need to be made non-static.. ?? + private static Quests quests = (Quests)Bukkit.getServer().getPluginManager().getPlugin("Quests"); public SpellCastObjective() { this.setName("Magic Spell Cast"); @@ -38,8 +42,8 @@ public void onSpellCast(CastEvent event) { // This fails in a pretty bad way if the player is not on a quest currently // There isn't a super clean way to check for this state so we'll just catch - // and ignore expections :\ - Quester quester = Quests.getInstance().getQuester(player.getUniqueId()); + // and ignore exceptions :\ + Quester quester = quests.getQuester(player.getUniqueId()); if (quester == null) { return; } diff --git a/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellUpgradeObjective.java b/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellUpgradeObjective.java index d22ee7f..d7d11eb 100644 --- a/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellUpgradeObjective.java +++ b/src/main/java/com/elmakers/mine/bukkit/magicquests/SpellUpgradeObjective.java @@ -7,6 +7,8 @@ import me.blackvein.quests.Quest; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; + +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -14,6 +16,8 @@ import java.util.Map; public class SpellUpgradeObjective extends CustomObjective { + // .... why did Quests.getInstance need to be made non-static.. ?? + private static Quests quests = (Quests) Bukkit.getServer().getPluginManager().getPlugin("Quests"); public SpellUpgradeObjective() { this.setName("Magic Spell Upgrade"); @@ -36,7 +40,7 @@ public void onSpellUpgrade(SpellUpgradeEvent event) { // This fails in a pretty bad way if the player is not on a quest currently // There isn't a super clean way to check for this state so we'll just catch // and ignore expections :\ - Quester quester = Quests.getInstance().getQuester(player.getUniqueId()); + Quester quester = quests.getQuester(player.getUniqueId()); if (quester == null) { return; }