diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 602f806f1d..25967d9126 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1056,7 +1056,6 @@ public class CraftWorld implements World { int blockZ = block.getZ(); // following code is lifted from Explosion.a(boolean), and modified net.minecraft.server.Block.byId[blockId].dropNaturally(this.world, blockX, blockY, blockZ, block.getData(), yield, 0); - net.minecraft.server.Block.byId[blockId].doActualDrop(this.world, blockX, blockY, blockZ); block.setType(org.bukkit.Material.AIR); // not sure what this does, seems to have something to do with the 'base' material of a block. // For example, WOODEN_STAIRS does something with WOOD in this method diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 6e89ef4de9..368cea9959 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -18,7 +18,6 @@ import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; import org.bukkit.block.PistonMoveReaction; import org.bukkit.craftbukkit.CraftChunk; -import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; @@ -348,7 +347,7 @@ public class CraftBlock implements Block { setTypeId(Material.AIR.getId()); if (block != null) { - block.b(chunk.getHandle().world, x, y, z, data, 0); + block.dropNaturally(chunk.getHandle().world, x, y, z, data, 1.0F, 0); return true; } return false; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index bee08c37a2..df942185a5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -20,7 +20,6 @@ import net.minecraft.server.InventoryCrafting; import net.minecraft.server.Item; import net.minecraft.server.ItemStack; import net.minecraft.server.Packet101CloseWindow; -import net.minecraft.server.Packet53BlockChange; import net.minecraft.server.World; import net.minecraft.server.WorldServer; @@ -511,49 +510,4 @@ public class CraftEventFactory { Bukkit.getPluginManager().callEvent(event); return event; } - - private static final List drops = new java.util.ArrayList(); - - public static boolean callBlockBreakEvent(World world, int x, int y, int z, int id, int data, boolean creative, EntityHuman player) { - net.minecraft.server.Block blockType = net.minecraft.server.Block.byId[id]; - if (blockType == null) { // Illegal block ID - return true; - } - - // Tell client the block is gone immediately then process events - if (world.getTileEntity(x, y, z) == null) { - Packet53BlockChange packet = new Packet53BlockChange(x, y, z, world); - - packet.material = 0; - packet.data = 0; - ((EntityPlayer) player).netServerHandler.sendPacket(packet); - } - - Block block = world.getWorld().getBlockAt(x, y, z); - List toDrop = blockType.calculateDrops(world, player, x, y, z, data); - drops.clear(); - - if (!creative && player.b(blockType)) { - for (ItemStack stack : toDrop) { - drops.add(new CraftItemStack(stack)); - } - } - - BlockBreakEvent event = new BlockBreakEvent(block, (org.bukkit.entity.Player) player.getBukkitEntity(), drops); - world.getServer().getPluginManager().callEvent(event); - - if (event.isCancelled()) { - toDrop.clear(); - // Let the client know the block still exists - ((EntityPlayer) player).netServerHandler.sendPacket(new Packet53BlockChange(x, y, z, world)); - return true; - } - - toDrop.clear(); - for (org.bukkit.inventory.ItemStack stack : drops) { - toDrop.add(CraftItemStack.createNMSItemStack(stack)); - } - - return false; // Event not cancelled - } }