mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 09:41:29 +01:00
Rework EntityExplodeEvent. Fixes BUKKIT-4140. Adds BUKKIT-4141
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
parent
42fab40633
commit
f06e7acda5
@ -1097,23 +1097,6 @@ public class CraftWorld implements World {
|
|||||||
return ((WorldNBTStorage) world.getDataManager()).getDirectory();
|
return ((WorldNBTStorage) world.getDataManager()).getDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void explodeBlock(Block block, float yield) {
|
|
||||||
// First of all, don't explode fire
|
|
||||||
if (block.getType().equals(org.bukkit.Material.AIR) || block.getType().equals(org.bukkit.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].wasExploded(this.world, blockX, blockY, blockZ, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
public void sendPluginMessage(Plugin source, String channel, byte[] message) {
|
||||||
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
|
StandardMessenger.validatePluginMessage(server.getMessenger(), source, channel, message);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user