Fixed holes in trees

This commit is contained in:
paulevsGitch 2020-12-10 22:18:25 +03:00
parent 491d5f0478
commit 858a7c8378
2 changed files with 14 additions and 2 deletions

View file

@ -10,7 +10,8 @@ public class BiomeAmberLand extends EndBiome {
super(new BiomeDefinition("amber_land") super(new BiomeDefinition("amber_land")
.setFogColor(255, 184, 71) .setFogColor(255, 184, 71)
.setFogDensity(2.0F) .setFogDensity(2.0F)
.setPlantsColor(122, 45, 122) .setPlantsColor(219, 115, 38)
.setWaterAndFogColor(145, 108, 72)
.setSurface(EndBlocks.AMBER_MOSS) .setSurface(EndBlocks.AMBER_MOSS)
.addFeature(EndFeatures.AMBER_ORE) .addFeature(EndFeatures.AMBER_ORE)
.addFeature(EndFeatures.END_LAKE_RARE) .addFeature(EndFeatures.END_LAKE_RARE)

View file

@ -95,13 +95,24 @@ public class HelixTreeFeature extends DefaultFeature {
int minY = MHelper.floor(lastPoint.getY()); int minY = MHelper.floor(lastPoint.getY());
int maxY = MHelper.floor(point.getY()); int maxY = MHelper.floor(point.getY());
float div = point.getY() - lastPoint.getY(); float div = point.getY() - lastPoint.getY();
for (float py = minY; py <= maxY; py += 0.1F) { for (float py = minY; py <= maxY; py += 0.2F) {
start.set(0, py, 0); start.set(0, py, 0);
float delta = (float) (py - minY) / div; float delta = (float) (py - minY) / div;
float px = MathHelper.lerp(delta, lastPoint.getX(), point.getX()); float px = MathHelper.lerp(delta, lastPoint.getX(), point.getX());
float pz = MathHelper.lerp(delta, lastPoint.getZ(), point.getZ()); float pz = MathHelper.lerp(delta, lastPoint.getZ(), point.getZ());
end.set(px, py, pz); end.set(px, py, pz);
fillLine(start, end, world, leaf, leafStart, i / 2 - 1); fillLine(start, end, world, leaf, leafStart, i / 2 - 1);
float ax = Math.abs(px);
float az = Math.abs(pz);
if (ax > az) {
start.add(0, 0, az > 0 ? 1 : -1);
end.add(0, 0, az > 0 ? 1 : -1);
}
else {
start.add(ax > 0 ? 1 : -1, 0, 0);
end.add(ax > 0 ? 1 : -1, 0, 0);
}
fillLine(start, end, world, leaf, leafStart, i / 2 - 1);
} }
lastPoint = point; lastPoint = point;
} }