2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockLeaves.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockLeaves.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -22,6 +22,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
|
|
|
+
|
2022-06-07 18:00:00 +02:00
|
|
|
public class BlockLeaves extends Block implements IBlockWaterlogged {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
public static final int DECAY_DISTANCE = 7;
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -48,6 +50,14 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2022-06-07 18:00:00 +02:00
|
|
|
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
|
|
|
if (this.decaying(iblockdata)) {
|
2018-07-15 02:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
2019-12-10 23:00:00 +01:00
|
|
|
+ LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
2021-06-11 13:33:49 +02:00
|
|
|
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (event.isCancelled() || worldserver.getBlockState(blockposition).getBlock() != this) {
|
2018-07-15 02:00:00 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
dropResources(iblockdata, worldserver, blockposition);
|
|
|
|
worldserver.removeBlock(blockposition, false);
|
2018-07-15 02:00:00 +02:00
|
|
|
}
|