mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
Fix crops not popping when no plugin listens to physics
This commit is contained in:
parent
e98c779a36
commit
51e360c648
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user