mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
18 lines
1,020 B
Diff
18 lines
1,020 B
Diff
--- a/net/minecraft/server/BlockPlant.java
|
|
+++ b/net/minecraft/server/BlockPlant.java
|
|
@@ -12,7 +12,14 @@
|
|
|
|
@Override
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
- return !iblockdata.canPlace(generatoraccess, blockposition) ? Blocks.AIR.getBlockData() : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
+ // CraftBukkit start
|
|
+ if (!iblockdata.canPlace(generatoraccess, blockposition)) {
|
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(generatoraccess, blockposition).isCancelled()) {
|
|
+ return Blocks.AIR.getBlockData();
|
|
+ }
|
|
+ }
|
|
+ return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
+ // CraftBukkit end
|
|
}
|
|
|
|
@Override
|