From cde18dc5298e4fab22a1b3d1df20c6acfd06d723 Mon Sep 17 00:00:00 2001 From: Intelli Date: Wed, 12 Jul 2023 16:33:50 -0600 Subject: [PATCH] Update formatting --- .../java/net/coreprotect/utility/Util.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index 932d9e40..96f60903 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -457,20 +457,18 @@ public static void mergeItems(Material material, ItemStack[] items) { try { int c1 = 0; for (ItemStack o1 : items) { - if (o1 != null) { - if (o1.getAmount() != 0) { - int c2 = 0; - for (ItemStack o2 : items) { - if (o2 != null && c2 > c1 && o1.isSimilar(o2) && !Util.isAir(o1.getType())) { // Ignores amount - int namount = o1.getAmount() + o2.getAmount(); - o1.setAmount(namount); - o2.setAmount(0); - } - c2++; + if (o1 != null && o1.getAmount() > 0) { + int c2 = 0; + for (ItemStack o2 : items) { + if (o2 != null && c2 > c1 && o1.isSimilar(o2) && !Util.isAir(o1.getType())) { // Ignores amount + int namount = o1.getAmount() + o2.getAmount(); + o1.setAmount(namount); + o2.setAmount(0); } + c2++; } } - c1++; + c1++; } } catch (Exception e) {