Skip to content

Commit

Permalink
Release 1.1 to work with Quests 3.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWolf committed Mar 24, 2018
1 parent 5853f72 commit 5a42226
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.elmakers.mine.bukkit.plugins</groupId>
<artifactId>MagicQuests</artifactId>
<version>1.1-SNAPSHOT</version>
<version>1.1</version>
<name>Magic Quests</name>
<url>http://mine.elmakers.com</url>

Expand Down Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.5.3</version>
<version>3.2.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
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;

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");
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
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;

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");
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
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;

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");
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
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;

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");
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
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;

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");
Expand All @@ -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;
}
Expand Down

0 comments on commit 5a42226

Please sign in to comment.