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 0740b3022f..334930f62e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -895,4 +895,21 @@ public class CraftWorld implements World { public File getWorldFolder() { return ((WorldNBTStorage)world.getDataManager()).getDirectory(); } + + public void explodeBlock(Block block, float yield) { + // First of all, don't explode fire + if (block.getType().equals(Material.FIRE)) { + return; + } + int blockId = block.getTypeId(); + int blockX = block.getX(); + int blockY = block.getY(); + 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); + 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 + net.minecraft.server.Block.byId[blockId].a_(this.world, blockX, blockY, blockZ); + } }