From a1652849ea7eafa6472bf955069b8991cc703dee Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 10 Mar 2016 07:53:32 +0100 Subject: [PATCH] 0.1h More easily fix bug in NmsItem --- src/com/massivecraft/massivecore/nms/NmsItem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/massivecore/nms/NmsItem.java b/src/com/massivecraft/massivecore/nms/NmsItem.java index f8731c99..33e19e1b 100644 --- a/src/com/massivecraft/massivecore/nms/NmsItem.java +++ b/src/com/massivecraft/massivecore/nms/NmsItem.java @@ -55,11 +55,13 @@ public class NmsItem extends NmsAbstract public static String itemToString(ItemStack item) { + if (item == null) throw new NullPointerException("item"); + if ( ! get().isAvailable()) return null; try { Object nmsItem = toNms.invoke(null, item); - if (nmsItem == null) throw new RuntimeException(); + if (nmsItem == null) throw new RuntimeException(item.toString()); String str = toJson.invoke(nmsItem, nbtTag.newInstance()).toString(); return str; }