From be34a2c84ad7ff3b72cee41db1ad2a29450979c4 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 9 Oct 2020 06:45:49 +1300 Subject: [PATCH] Better Array handling --- .../disguise/utilities/DisguiseUtilities.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 46fd1c83..7344ac33 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -2732,11 +2732,10 @@ public class DisguiseUtilities { case TAG_BYTE_ARRAY: case TAG_INT_ARRAY: case TAG_LONG_ARRAY: - Object[] array = (Object[]) base.getValue(); - String[] str = new String[array.length]; + String[] str = new String[Array.getLength(base.getValue())]; - for (int i = 0; i < array.length; i++) { - str[i] = array[i].toString();//+ getChar(base.getType()); + for (int i = 0; i < str.length; i++) { + str[i] = Array.get(base.getValue(),i).toString();//+ getChar(base.getType()); } return "[" + StringUtils.join(str, ",") + "]";