Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix(jaoBox): #727 旧サイズが0の場合にエラーが出る不具合を修正 (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Jun 15, 2022
1 parent a9b7b9a commit 921b904
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/com/jaoafa/mymaid4/event/Event_jaoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ public void onRegisterInventoryClose(InventoryCloseEvent event) {
}

List<ItemStack> oldItems = MyMaidData.getBoxPrevious(player.getUniqueId());
for (int i = 0; i < inventory.getSize(); i++) {
ItemStack oldItem = oldItems.get(i);
ItemStack newItem = inventory.getItem(i);
if (oldItems.size() != 0) {
for (int i = 0; i < inventory.getSize(); i++) {
ItemStack oldItem = oldItems.get(i);
ItemStack newItem = inventory.getItem(i);

if (Objects.equals(oldItem, newItem)) {
continue;
}
if (Objects.equals(oldItem, newItem)) {
continue;
}

logging(player, i, oldItem, newItem);
logging(player, i, oldItem, newItem);
}
}

player.getWorld().playSound(player.getLocation(), Sound.BLOCK_CHEST_LOCKED, 1.0F, 1.0F);
Expand Down

0 comments on commit 921b904

Please sign in to comment.