Manually copy arena container contents; fixes reduce-to-0 bug.

This commit is contained in:
garbagemule 2014-04-07 00:55:17 +02:00
parent c954234229
commit f96eb5ac47
2 changed files with 8 additions and 2 deletions

View File

@ -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:

View File

@ -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();