[Bleeding] Fixed blocks dropping when BlockBreakEvent is canceled. Fixes BUKKIT-1299

This commit is contained in:
feildmaster 2012-03-23 09:49:34 -05:00 committed by EvilSeph
parent 942c1c6a3e
commit 9c7ffb6d3c
2 changed files with 2 additions and 1 deletions

View file

@ -564,7 +564,7 @@ public class Block {
} else {
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman.inventory);
this.b(world, i, j, k, l, i1);
this.dropNaturally(world, i, j, k, l, 1.0F, i1); // CraftBukkit
}
return this.dropList; // CraftBukkit
}

View file

@ -539,6 +539,7 @@ public class CraftEventFactory {
world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
blockType.setDrops(new ArrayList<ItemStack>());
// Let the client know the block still exists
((EntityPlayer) player).netServerHandler.sendPacket(new Packet53BlockChange(x, y, z, world));
return true;