mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 13:40:24 -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
|
--- a/net/minecraft/world/level/block/FarmBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/FarmBlock.java
|
+++ b/net/minecraft/world/level/block/FarmBlock.java
|
||||||
@@ -95,31 +_,56 @@
|
@@ -95,31 +_,59 @@
|
||||||
@Override
|
@Override
|
||||||
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
|
||||||
int moistureValue = state.getValue(MOISTURE);
|
int moistureValue = state.getValue(MOISTURE);
|
||||||
@ -53,9 +53,12 @@
|
|||||||
|
|
||||||
public static void turnToDirt(@Nullable Entity entity, BlockState state, Level level, BlockPos pos) {
|
public static void turnToDirt(@Nullable Entity entity, BlockState state, Level level, BlockPos pos) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
+ if (entity == null) {
|
||||||
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory
|
||||||
|
+ .callBlockFadeEvent(level, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
BlockState blockState = pushEntitiesUp(state, Blocks.DIRT.defaultBlockState(), level, pos);
|
BlockState blockState = pushEntitiesUp(state, Blocks.DIRT.defaultBlockState(), level, pos);
|
||||||
level.setBlockAndUpdate(pos, blockState);
|
level.setBlockAndUpdate(pos, blockState);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user