mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:05:59 +03:00
28 lines
976 B
Diff
28 lines
976 B
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
|
@@ -2,6 +2,9 @@
|
|
|
|
import java.util.Random;
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.event.block.LeavesDecayEvent;
|
|
+
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.block.properties.PropertyBool;
|
|
import net.minecraft.block.state.IBlockState;
|
|
@@ -178,6 +181,14 @@
|
|
|
|
private void destroy(World worldIn, BlockPos pos)
|
|
{
|
|
+ // CraftBukkit start
|
|
+ LeavesDecayEvent event = new LeavesDecayEvent(worldIn.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
|
+ worldIn.getServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (event.isCancelled() || worldIn.getBlockState(pos).getBlock() != this) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0);
|
|
worldIn.setBlockToAir(pos);
|
|
}
|