fix infinite loop in BushTreeFeature (#1589)

This commit is contained in:
LoganDark 2020-04-21 04:23:31 -07:00 committed by GitHub
parent 3d69190338
commit 21ae14f67b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ public class BushTreeFeature extends TreeFeatureBase
protected boolean place(Set<BlockPos> changedLogs, Set<BlockPos> changedLeaves, IWorld world, Random random, BlockPos startPos, MutableBoundingBox boundingBox)
{
// Move down until we reach the ground
while (startPos.getY() > 1 && world.isEmptyBlock(startPos) || world.getBlockState(startPos).getMaterial() == Material.AIR) {startPos = startPos.below();}
while (startPos.getY() > 1 && (world.isEmptyBlock(startPos) || world.getBlockState(startPos).getMaterial() == Material.AIR)) {startPos = startPos.below();}
if (!this.placeOn.matches(world, startPos))
{