Use safeItemInsert() for inventory clearing (#566)

This commit is contained in:
Bloepiloepi 2021-12-28 23:43:30 +01:00 committed by TheMode
parent 8773e616fb
commit d64c708c60
1 changed files with 3 additions and 1 deletions

View File

@ -164,7 +164,9 @@ public sealed abstract class AbstractInventory implements InventoryClickHandler,
*/
public synchronized void clear() {
// Clear the item array
Arrays.fill(itemStacks, ItemStack.AIR);
for (int i = 0; i < size; i++) {
safeItemInsert(i, ItemStack.AIR);
}
// Send the cleared inventory to viewers
update();
}