Fix block physics for plants

This commit is contained in:
Beaness 2022-08-01 14:48:26 +02:00
parent 1d1ba70ae9
commit fbdfac6a23

View File

@ -42,8 +42,9 @@ public class BlockPlant extends Block {
}
protected void e(World world, BlockPosition blockposition, IBlockData iblockdata) {
if (!this.f(world, blockposition, iblockdata) && ((WorldServer) world).hasPhysicsEvent) { // PandaSpigot - hasPhysicsEvent
if (!this.f(world, blockposition, iblockdata)) {
// CraftBukkit Start
if (((WorldServer) world).hasPhysicsEvent) { // PandaSpigot - hasPhysicsEvent
org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
BlockPhysicsEvent event = new BlockPhysicsEvent(block, block.getTypeId());
world.getServer().getPluginManager().callEvent(event);
@ -51,11 +52,11 @@ public class BlockPlant extends Block {
if (event.isCancelled()) {
return;
}
}
// CraftBukkit end
this.b(world, blockposition, iblockdata, 0);
world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
}
}
public boolean f(World world, BlockPosition blockposition, IBlockData iblockdata) {