mirror of
https://github.com/Eaglercraft-Archive/EaglercraftX-1.8-workspace.git
synced 2026-06-21 10:33:43 +02:00
u23
This commit is contained in:
@@ -69,6 +69,29 @@ public class BlockGrass extends Block implements IGrowable {
|
||||
return BiomeColorHelper.getGrassColorAtPos(iblockaccess, blockpos);
|
||||
}
|
||||
|
||||
public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) {
|
||||
if (!world.isRemote) {
|
||||
if (world.getLightFromNeighbors(blockpos.up()) < 4
|
||||
&& world.getBlockState(blockpos.up()).getBlock().getLightOpacity() > 2) {
|
||||
world.setBlockState(blockpos, Blocks.dirt.getDefaultState());
|
||||
} else {
|
||||
if (world.getLightFromNeighbors(blockpos.up()) >= 9) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
BlockPos blockpos1 = blockpos.add(random.nextInt(3) - 1, random.nextInt(5) - 3,
|
||||
random.nextInt(3) - 1);
|
||||
Block block = world.getBlockState(blockpos1.up()).getBlock();
|
||||
IBlockState iblockstate = world.getBlockState(blockpos1);
|
||||
if (iblockstate.getBlock() == Blocks.dirt
|
||||
&& iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT
|
||||
&& world.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2) {
|
||||
world.setBlockState(blockpos1, Blocks.grass.getDefaultState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**+
|
||||
* Get the Item that this Block should drop when harvested.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user