Fix tree spawning issue.

This commit is contained in:
dfsek 2020-10-02 02:56:44 -07:00
parent 996c153b9a
commit c38939f334
2 changed files with 7 additions and 3 deletions

View File

@ -87,7 +87,7 @@
<dependency>
<groupId>org.polydev</groupId>
<artifactId>gaea</artifactId>
<version>1.10.82</version>
<version>1.10.83</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

View File

@ -33,8 +33,12 @@ public class TreePopulator extends GaeaBlockPopulator {
int att = 0;
for(int i = 0; i < b.getDecorator().getTreeDensity() && att < max; ) {
att++;
int y = WorldUtil.getHighestValidSpawnAt(chunk, x, z);
if(y <= 0) continue;
int y = 255;
while(y > 1) {
if(chunk.getBlock(x, y, z).getType().isAir() && chunk.getBlock(x, y-1, z).getType().isSolid()) break;
y--;
}
if(y == 0) continue;
origin = chunk.getBlock(x, y, z).getLocation().add(0, 1, 0);
b = grid.getBiome(origin, GenerationPhase.POPULATE);
try {