From aabc2b057fb65cdef28093d2fb169957d3636f80 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Nov 2016 02:30:25 +0100 Subject: [PATCH 1/2] No! My way! --- src/main/java/buttondevteam/lib/DebugPotatoAPI.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/buttondevteam/lib/DebugPotatoAPI.java b/src/main/java/buttondevteam/lib/DebugPotatoAPI.java index be138c8..da415eb 100644 --- a/src/main/java/buttondevteam/lib/DebugPotatoAPI.java +++ b/src/main/java/buttondevteam/lib/DebugPotatoAPI.java @@ -15,13 +15,9 @@ 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){ - List message = new ArrayList(); - message.add("nullMessage"); - meta.setLore(message); - }else{ - meta.setLore(dp.getMessage()); - } + if (dp.getMessage() == null) + dp.setMessage("nullMessage"); + meta.setLore(dp.getMessage()); potato.setItemMeta(meta); potato.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 10); return potato; From 282adbc09884d9cab939875108abdc5dea16633f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Nov 2016 02:44:22 +0100 Subject: [PATCH 2/2] Fixed NPE --- src/main/java/buttondevteam/lib/TBMCPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/buttondevteam/lib/TBMCPlayer.java b/src/main/java/buttondevteam/lib/TBMCPlayer.java index 80cd053..203328f 100644 --- a/src/main/java/buttondevteam/lib/TBMCPlayer.java +++ b/src/main/java/buttondevteam/lib/TBMCPlayer.java @@ -157,6 +157,8 @@ public class TBMCPlayer implements AutoCloseable { if (!mname.startsWith("get")) throw new UnsupportedOperationException("Can only use getIntData from a getXYZ method"); Object obj = getLoadedPlayers().get(uuid).data.get(mname.substring("get".length()).toLowerCase()); + if (obj == null) + return null; if (obj instanceof Short) return (T) obj; if (!(Integer.class.isAssignableFrom(obj.getClass())))