mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
Correctly call BlockFadeEvents (#12141)
This commit is contained in:
parent
142695eb00
commit
e494f2894e
@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -95,31 +_,56 @@
|
||||
@@ -95,31 +_,59 @@
|
||||
@Override
|
||||
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
||||
int moistureValue = state.getValue(MOISTURE);
|
||||
@ -53,8 +53,11 @@
|
||||
|
||||
public static void turnToDirt(@Nullable Entity entity, BlockState state, Level level, BlockPos pos) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
||||
+ return;
|
||||
+ if (entity == null) {
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory
|
||||
+ .callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
BlockState blockState = pushEntitiesUp(state, Blocks.DIRT.defaultBlockState(), level, pos);
|
||||
|
Loading…
x
Reference in New Issue
Block a user