From c378dc8e785a3d2a7521e35bfc00ccd456f1e2a6 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 7 Jul 2017 20:47:22 +1200 Subject: [PATCH] Allow ItemStack parsings to be null --- src/me/libraryaddict/disguise/utilities/DisguiseParser.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseParser.java b/src/me/libraryaddict/disguise/utilities/DisguiseParser.java index 69c7da4b..0e781887 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseParser.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseParser.java @@ -750,7 +750,7 @@ public class DisguiseParser { // Parse to itemstack array ItemStack[] items = new ItemStack[4]; - String[] split = valueString.split(","); + String[] split = valueString.split(",", -1); if (split.length == 4) { for (int a = 0; a < 4; a++) { @@ -933,7 +933,9 @@ public class DisguiseParser { int itemId = -1; - if (isInteger(split[0])) { + if (split[0].isEmpty() || split[0].equalsIgnoreCase("null")) { + return null; + } else if (isInteger(split[0])) { itemId = Integer.parseInt(split[0]); } else { try {