mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-18 22:24:29 +00:00
Allow ItemStack parsings to be null
This commit is contained in:
parent
c8b908edd3
commit
c378dc8e78
1 changed files with 4 additions and 2 deletions
|
@ -750,7 +750,7 @@ public class DisguiseParser {
|
||||||
// Parse to itemstack array
|
// Parse to itemstack array
|
||||||
ItemStack[] items = new ItemStack[4];
|
ItemStack[] items = new ItemStack[4];
|
||||||
|
|
||||||
String[] split = valueString.split(",");
|
String[] split = valueString.split(",", -1);
|
||||||
|
|
||||||
if (split.length == 4) {
|
if (split.length == 4) {
|
||||||
for (int a = 0; a < 4; a++) {
|
for (int a = 0; a < 4; a++) {
|
||||||
|
@ -933,7 +933,9 @@ public class DisguiseParser {
|
||||||
|
|
||||||
int itemId = -1;
|
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]);
|
itemId = Integer.parseInt(split[0]);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue