-
-
Save anonymous/d91cd976fe264a8d49a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public WorldGenTallGrass(BlockTallGrass.EnumType p_i45629_1_) | |
{ | |
this.field_175907_a = Blocks.tallgrass.getDefaultState().withProperty(BlockTallGrass.TYPE, p_i45629_1_); | |
} | |
or | |
public boolean generate(World worldIn, Random p_180709_2_, BlockPos p_180709_3_) | |
{ | |
Block block; | |
do | |
{ | |
block = worldIn.getBlockState(p_180709_3_).getBlock(); | |
if (!block.isAir(worldIn, p_180709_3_) && !block.isLeaves(worldIn, p_180709_3_)) break; | |
p_180709_3_ = p_180709_3_.down(); | |
} while (p_180709_3_.getY() > 0); | |
for (int i = 0; i < 128; ++i) | |
{ | |
BlockPos blockpos1 = p_180709_3_.add(p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8), p_180709_2_.nextInt(4) - p_180709_2_.nextInt(4), p_180709_2_.nextInt(8) - p_180709_2_.nextInt(8)); | |
if (worldIn.isAirBlock(blockpos1) && Blocks.tallgrass.canBlockStay(worldIn, blockpos1, this.field_175907_a)) | |
{ | |
worldIn.setBlockState(blockpos1, this.field_175907_a, 2); | |
} | |
} | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment