@@ -9,18 +9,18 @@
|
||||
public class BlockLeaves extends Block {
|
||||
|
||||
public static final BlockStateInteger DISTANCE = BlockProperties.ah;
|
||||
@@ -21,6 +23,14 @@
|
||||
@@ -20,6 +22,14 @@
|
||||
@Override
|
||||
public void c(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
public void b(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) {
|
||||
+ // CraftBukkit start
|
||||
+ LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+ LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ worldserver.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled() || world.getType(blockposition).getBlock() != this) {
|
||||
+ if (event.isCancelled() || worldserver.getType(blockposition).getBlock() != this) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
c(iblockdata, world, blockposition);
|
||||
world.a(blockposition, false);
|
||||
c(iblockdata, (World) worldserver, blockposition);
|
||||
worldserver.a(blockposition, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user