diff --git a/pom.xml b/pom.xml index 4a4e11e42..2b3152fb1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 1.5.2-SNAPSHOT + 1.6.2-SNAPSHOT quests http://dev.bukkit.org/server-mods/quests/ jar diff --git a/src/me/blackvein/quests/items.txt b/src/items.txt similarity index 100% rename from src/me/blackvein/quests/items.txt rename to src/items.txt diff --git a/src/me/blackvein/quests/prompts/ItemStackPrompt.java b/src/me/blackvein/quests/prompts/ItemStackPrompt.java index bd7b1fd84..9f12938b3 100644 --- a/src/me/blackvein/quests/prompts/ItemStackPrompt.java +++ b/src/me/blackvein/quests/prompts/ItemStackPrompt.java @@ -12,6 +12,7 @@ import me.blackvein.quests.ItemData.Data; import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.conversations.ConversationContext; @@ -229,7 +230,6 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil{ if(input.equalsIgnoreCase("cancel") == false){ try{ - Material mat = Material.getMaterial(Integer.parseInt(input)); if(mat == null){ cc.getForWhom().sendRawMessage(RED + "Invalid item ID!"); @@ -240,14 +240,22 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil{ } }catch(Exception e){ - Data data = ItemData.getInstance().getItem(input); - if (data == null) { + try { + Data data = ItemData.getInstance().getItem(input); + Bukkit.broadcastMessage(input + ":" + data); + if (data == null) { + cc.getForWhom().sendRawMessage(RED + "Invalid item ID!"); + return new IDPrompt(); + } else { + + cc.setSessionData("tempId", data.getId()); + cc.setSessionData("tempData", (data.getData() == 0) ? null : (short)data.getData()); + return new ItemStackPrompt(oldPrompt); + } + } catch (Exception e1) { + e1.printStackTrace(); cc.getForWhom().sendRawMessage(RED + "Invalid item ID!"); return new IDPrompt(); - } else { - cc.setSessionData("tempId", data.getId()); - cc.setSessionData("tempData", data.getData()); - return new ItemStackPrompt(oldPrompt); } } diff --git a/src/me/blackvein/quests/prompts/RequirementsPrompt.java b/src/me/blackvein/quests/prompts/RequirementsPrompt.java index 8c85ab263..c3aa07df7 100644 --- a/src/me/blackvein/quests/prompts/RequirementsPrompt.java +++ b/src/me/blackvein/quests/prompts/RequirementsPrompt.java @@ -239,15 +239,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{ } - Collections.sort(questNames, new Comparator(){ + Collections.sort(questNames, new Comparator(){ @Override - public int compare(Object one, Object two){ + public int compare(String one, String two){ - String s = (String) one; - String s2 = (String) two; - - return s.compareTo(s2); + return one.compareTo(two); }