mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-17 04:51:28 +01:00
Manually copy arena container contents; fixes reduce-to-0 bug.
This commit is contained in:
parent
c954234229
commit
f96eb5ac47
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.96.3.2
|
||||
version: 0.96.3.3
|
||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -15,7 +15,13 @@ public class RepairableContainer extends RepairableBlock
|
||||
|
||||
// Grab the inventory of the block
|
||||
Inventory inv = ((InventoryHolder) state).getInventory();
|
||||
contents = inv.getContents();
|
||||
ItemStack[] stacks = inv.getContents();
|
||||
|
||||
// Manual copy is necessary due to "reduce to 0" bug in Bukkit
|
||||
contents = new ItemStack[stacks.length];
|
||||
for (int i = 0; i < contents.length; i++) {
|
||||
contents[i] = (stacks[i] != null) ? stacks[i].clone() : null;
|
||||
}
|
||||
|
||||
// Clear the inventory if prompted
|
||||
if (clear) inv.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user