From 34529c76a61298ac3f7306b92c5d38997f7816f0 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 19 Nov 2016 20:28:24 -0500 Subject: [PATCH] Made potatoes happy and fun --- src/main/java/buttondevteam/lib/DebugPotatoAPI.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/buttondevteam/lib/DebugPotatoAPI.java b/src/main/java/buttondevteam/lib/DebugPotatoAPI.java index fa7d699..be138c8 100644 --- a/src/main/java/buttondevteam/lib/DebugPotatoAPI.java +++ b/src/main/java/buttondevteam/lib/DebugPotatoAPI.java @@ -1,5 +1,8 @@ package buttondevteam.lib; +import java.util.ArrayList; +import java.util.List; + import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.enchantments.Enchantment; @@ -12,9 +15,13 @@ public class DebugPotatoAPI { ItemStack potato = new ItemStack(Material.BAKED_POTATO); ItemMeta meta = potato.getItemMeta(); meta.setDisplayName(dp.getType() == null ? "Spicy Debug Potato" : dp.getType()); - if (dp.getMessage() == null) - throw new IllegalArgumentException("Potato message is empty!"); - meta.setLore(dp.getMessage()); + if (dp.getMessage() == null){ + List message = new ArrayList(); + message.add("nullMessage"); + meta.setLore(message); + }else{ + meta.setLore(dp.getMessage()); + } potato.setItemMeta(meta); potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); return potato;