From fbdfac6a230008b9f1f5fd77e9ef0d4493739e35 Mon Sep 17 00:00:00 2001 From: Beaness Date: Mon, 1 Aug 2022 14:48:26 +0200 Subject: [PATCH] Fix block physics for plants --- .../java/net/minecraft/server/BlockPlant.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/eSpigot-Server/src/main/java/net/minecraft/server/BlockPlant.java b/eSpigot-Server/src/main/java/net/minecraft/server/BlockPlant.java index 6697837..eb6ff57 100644 --- a/eSpigot-Server/src/main/java/net/minecraft/server/BlockPlant.java +++ b/eSpigot-Server/src/main/java/net/minecraft/server/BlockPlant.java @@ -42,20 +42,21 @@ 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 - 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); + 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); - if (event.isCancelled()) { - return; + 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) {