*Changed stuff

This commit is contained in:
Zino 2013-07-16 16:17:10 +02:00
parent 5e59895fe4
commit 5842d10a08
4 changed files with 19 additions and 14 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>1.5.2-SNAPSHOT</version>
<version>1.6.2-SNAPSHOT</version>
<name>quests</name>
<url>http://dev.bukkit.org/server-mods/quests/</url>
<packaging>jar</packaging>

View File

@ -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);
}
}

View File

@ -239,15 +239,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil{
}
Collections.sort(questNames, new Comparator(){
Collections.sort(questNames, new Comparator<String>(){
@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);
}