Test commit

This commit is contained in:
HappyPikachu 2015-01-07 21:56:46 -05:00
parent a8754bfa13
commit c78a1aae05
2 changed files with 3 additions and 3 deletions

View File

@ -3514,7 +3514,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
deliveryMessages.addAll(config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".delivery-messages"));
for (String item : itemsToDeliver) {
getLogger().severe("item: " + item);
ItemStack is = ItemUtil.readItemStack(item);
if (is != null) {

View File

@ -79,10 +79,11 @@ public class ItemUtil implements ColorUtil {
//Formats -> name-name:amount-amount:data-data:enchantment-enchantment level:displayname-displayname:lore-lore:
//Returns null if invalid format
public static ItemStack readItemStack(String data) {
plugin.getLogger().severe("data: " + data);
if (data == null) {
return null;
}
ItemStack stack = null;
String[] args = data.split(":");
ItemMeta meta = null;
@ -93,7 +94,6 @@ public class ItemUtil implements ColorUtil {
stack = new ItemStack(Material.matchMaterial(arg.substring(3)));
meta = stack.getItemMeta();
} else if (arg.startsWith("amount-")) {
if(arg.length() >= 8 && stack != null)
stack.setAmount(Integer.parseInt(arg.substring(7)));
} else if (arg.startsWith("data-")) {
stack.setDurability(Short.parseShort(arg.substring(5)));