Fix crops not popping when no plugin listens to physics
This commit is contained in:
@@ -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
|
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
|
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
|
--- a/src/main/java/net/minecraft/server/BlockPlant.java
|
||||||
+++ b/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 {
|
@@ -0,0 +0,0 @@ public class BlockPlant extends Block {
|
||||||
@@ -14,7 +14,7 @@ index 0e4037ea21..736f794fd1 100644
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
|
if (!iblockdata.canPlace(generatoraccess, blockposition)) {
|
||||||
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) {
|
- 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();
|
return Blocks.AIR.getBlockData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user