Manually copy arena container contents; fixes reduce-to-0 bug.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
name: MobArena
|
name: MobArena
|
||||||
author: garbagemule
|
author: garbagemule
|
||||||
main: com.garbagemule.MobArena.MobArena
|
main: com.garbagemule.MobArena.MobArena
|
||||||
version: 0.96.3.2
|
version: 0.96.3.3
|
||||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||||
commands:
|
commands:
|
||||||
ma:
|
ma:
|
||||||
|
|||||||
@@ -15,7 +15,13 @@ public class RepairableContainer extends RepairableBlock
|
|||||||
|
|
||||||
// Grab the inventory of the block
|
// Grab the inventory of the block
|
||||||
Inventory inv = ((InventoryHolder) state).getInventory();
|
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
|
// Clear the inventory if prompted
|
||||||
if (clear) inv.clear();
|
if (clear) inv.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user