mirror of https://github.com/Minestom/Minestom.git
Use safeItemInsert() for inventory clearing (#566)
This commit is contained in:
parent
8773e616fb
commit
d64c708c60
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue