Skip to content

Commit

Permalink
Fix air being set when the sample didn't generate
Browse files Browse the repository at this point in the history
  • Loading branch information
oitsjustjose committed Feb 17, 2019
1 parent 572b99c commit 1c26a16
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void addChunk(ChunkPos pos, World world, IBlockState state, int depositHe
}
if (ModConfig.prospecting.generateInWater || !isMoist(world, p))
{
world.setBlockState(p.up(), Blocks.AIR.getDefaultState(), 2 | 16);
world.setBlockState(p, state, 2 | 16);
}
}
Expand Down Expand Up @@ -72,16 +73,12 @@ private BlockPos getSamplePos(World world, ChunkPos chunkPos, int depositHeight)
// If it's above sea level it's fine
if (searchPos.getY() > world.getSeaLevel())
{
// Set the block above to air because we have a whitelist system
world.setBlockState(searchPos.up(), Blocks.AIR.getDefaultState(), 2 | 16);
return searchPos;
}
// If not, it's gotta be at least 12 blocks away from it (i.e. below it) but at least above the deposit
else if (isWithinRange(world.getSeaLevel(), searchPos.getY(), 12)
&& searchPos.getY() < depositHeight)
{
// Set the block above to air because we have a whitelist system
world.setBlockState(searchPos.up(), Blocks.AIR.getDefaultState(), 2 | 16);
return searchPos;
}
}
Expand Down

0 comments on commit 1c26a16

Please sign in to comment.