Skip to content

Commit

Permalink
Update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Jul 12, 2023
1 parent d200616 commit cde18dc
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/main/java/net/coreprotect/utility/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cde18dc

Please sign in to comment.