@@ -15,7 +15,7 @@
|
||||
+
|
||||
public class BlockSapling extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
public static final BlockStateInteger STAGE = BlockProperties.at;
|
||||
public static final BlockStateInteger STAGE = BlockProperties.au;
|
||||
protected static final VoxelShape b = Block.a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
|
||||
private final WorldGenTreeProvider c;
|
||||
+ public static TreeType treeType; // CraftBukkit
|
||||
@@ -23,21 +23,21 @@
|
||||
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, Block.Info block_info) {
|
||||
super(block_info);
|
||||
@@ -23,7 +33,30 @@
|
||||
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
super.tick(iblockdata, world, blockposition, random);
|
||||
if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
super.tick(iblockdata, worldserver, blockposition, random);
|
||||
if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
|
||||
+ // CraftBukkit start
|
||||
+ world.captureTreeGeneration = true;
|
||||
+ worldserver.captureTreeGeneration = true;
|
||||
+ // CraftBukkit end
|
||||
this.grow(world, blockposition, iblockdata, random);
|
||||
this.grow(worldserver, blockposition, iblockdata, random);
|
||||
+ // CraftBukkit start
|
||||
+ world.captureTreeGeneration = false;
|
||||
+ if (world.capturedBlockStates.size() > 0) {
|
||||
+ worldserver.captureTreeGeneration = false;
|
||||
+ if (worldserver.capturedBlockStates.size() > 0) {
|
||||
+ TreeType treeType = BlockSapling.treeType;
|
||||
+ BlockSapling.treeType = null;
|
||||
+ Location location = new Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ List<BlockState> blocks = (List<BlockState>) world.capturedBlockStates.clone();
|
||||
+ world.capturedBlockStates.clear();
|
||||
+ Location location = new Location(worldserver.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ List<BlockState> blocks = (List<BlockState>) worldserver.capturedBlockStates.clone();
|
||||
+ worldserver.capturedBlockStates.clear();
|
||||
+ StructureGrowEvent event = null;
|
||||
+ if (treeType != null) {
|
||||
+ event = new StructureGrowEvent(location, treeType, false, null, blocks);
|
||||
|
||||
Reference in New Issue
Block a user