Skip to content

Commit

Permalink
set a better range for rubber tree size
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Dec 30, 2021
1 parent 5ba27e2 commit fac5dee
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ public boolean grow(World world, BlockPos pos, Random random) {
if (height < 2)
return false;
height -= random.nextInt(height / 2 + 1);
height = Math.max(5, height);
BlockPos.MutableBlockPos tmpPos = new BlockPos.MutableBlockPos();
for (int cHeight = 0; cHeight < height; cHeight++) {
BlockPos cPos = pos.up(cHeight);
setBlockAndNotifyAdequately(world, cPos, woodBlock);
if (height < 4 || (height < 7 && cHeight > 1) || cHeight > 2) {
if ((height < 7 && cHeight > 1) || cHeight > 2) {
for (int cx = pos.getX() - 2; cx <= pos.getX() + 2; cx++) {
for (int cz = pos.getZ() - 2; cz <= pos.getZ() + 2; cz++) {
int chance = Math.max(1, cHeight + 4 - height);
Expand Down Expand Up @@ -85,7 +86,7 @@ public int getGrowHeight(World world, BlockPos pos) {
return 0;
int height = 1;
pos = pos.up();
while (world.isAirBlock(pos) && height < 8) {
while (world.isAirBlock(pos) && height < 7) {
pos = pos.up();
height++;
}
Expand Down

0 comments on commit fac5dee

Please sign in to comment.