tweaks to swamp surface

This commit is contained in:
dags- 2020-05-14 21:40:55 +01:00
parent f48d42f529
commit cc5c3c48d5
5 changed files with 5 additions and 6 deletions

View File

@ -73,6 +73,7 @@ public class TerraWorld extends WorldType {
if (world.getDimension().getType() == DimensionType.OVERWORLD) {
WorldInfo info = world.getWorldInfo();
TerraSettings settings = SettingsHelper.getSettings(info);
settings.world.seed = world.getSeed();
settings.dimensions.dimensions.apply(world.getWorldInfo());
Terrains terrains = Terrains.create(settings);

View File

@ -35,7 +35,6 @@ import net.minecraft.world.gen.GenerationSettings;
public class SurfaceContext extends DecoratorContext {
public final long seed;
public final int seaLevel;
public final BlockState solid;
public final BlockState fluid;
public final ChunkSurfaceBuffer buffer;
@ -48,7 +47,6 @@ public class SurfaceContext extends DecoratorContext {
this.solid = settings.getDefaultBlock();
this.fluid = settings.getDefaultFluid();
this.buffer = buffer;
this.seaLevel = levels.waterLevel;
this.seed = seed;
}
}

View File

@ -60,7 +60,7 @@ public class Delegate implements Surface {
context.noise,
context.solid,
context.fluid,
context.seaLevel,
context.levels.waterLevel,
context.seed
);
}

View File

@ -22,13 +22,13 @@ public class SwampSurface implements Surface {
continue;
}
if (y == ctx.seaLevel && ctx.buffer.getBlockState(ctx.pos).getBlock() != ctx.fluid.getBlock()) {
if (y == ctx.levels.waterY && ctx.buffer.getBlockState(ctx.pos).getBlock() != ctx.fluid.getBlock()) {
ctx.buffer.setBlockState(ctx.pos, ctx.fluid, false);
}
break;
}
}
SurfaceBuilder.DEFAULT.buildSurface(ctx.random, ctx.buffer, ctx.biome, x, z, height, noise, ctx.solid, ctx.fluid, ctx.seaLevel, ctx.seed, config);
SurfaceBuilder.DEFAULT.buildSurface(ctx.random, ctx.buffer, ctx.biome, x, z, height, noise, ctx.solid, ctx.fluid, ctx.levels.waterLevel, ctx.seed, config);
}
}

View File

@ -59,7 +59,7 @@ public class TerrainGenerator {
container.getChunkReader().iterate(context, (cell, dx, dz, ctx) -> {
int px = ctx.blockX + dx;
int pz = ctx.blockZ + dz;
int top = ctx.chunk.getTopBlockY(Heightmap.Type.WORLD_SURFACE_WG, dx, dz) + 1;
int top = ctx.chunk.getTopBlockY(Heightmap.Type.WORLD_SURFACE_WG, dx, dz);
ctx.buffer.setSurfaceLevel(top);