From 51e360c648dda37eb22380fd5d970828313f7ad9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Mar 2019 12:22:24 -0500 Subject: [PATCH] Fix crops not popping when no plugin listens to physics --- ...Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 578511f0a0..267da0d6a4 100644 --- a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java -index 0e4037ea21..736f794fd1 100644 +index 0e4037ea21..317ae16347 100644 --- a/src/main/java/net/minecraft/server/BlockPlant.java +++ b/src/main/java/net/minecraft/server/BlockPlant.java @@ -0,0 +0,0 @@ public class BlockPlant extends Block { @@ -14,7 +14,7 @@ index 0e4037ea21..736f794fd1 100644 // CraftBukkit start if (!iblockdata.canPlace(generatoraccess, blockposition)) { - if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) { -+ if (generatoraccess instanceof WorldServer && ((WorldServer) generatoraccess).hasPhysicsEvent && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) { // Paper ++ if (!(generatoraccess instanceof WorldServer && ((WorldServer) generatoraccess).hasPhysicsEvent) || !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) { // Paper return Blocks.AIR.getBlockData(); } }