add carving.update-palette option

This commit is contained in:
dfsek
2022-06-11 23:30:53 -07:00
parent 881477c42f
commit a33982a432
3 changed files with 9 additions and 2 deletions

View File

@@ -59,6 +59,10 @@ public class BiomePaletteTemplate implements ObjectTemplate<PaletteInfo> {
}
};
@Value("carving.update-palette")
@Default
private boolean updatePalette = false;
public BiomePaletteTemplate(Platform platform) { this.platform = platform; }
@Override
@@ -79,6 +83,6 @@ public class BiomePaletteTemplate implements ObjectTemplate<PaletteInfo> {
slantLayers.put(threshold, layer.getPalette());
}
return new PaletteInfo(builder.build(), SlantHolder.of(slantLayers, minThreshold), oceanPalette, seaLevel, slantDepth);
return new PaletteInfo(builder.build(), SlantHolder.of(slantLayers, minThreshold), oceanPalette, seaLevel, slantDepth, updatePalette);
}
}

View File

@@ -17,5 +17,6 @@ public record PaletteInfo(PaletteHolder paletteHolder,
SlantHolder slantHolder,
Palette ocean,
int seaLevel,
int maxSlantDepth) implements Properties {
int maxSlantDepth,
boolean updatePaletteWhenCarving) implements Properties {
}

View File

@@ -90,6 +90,8 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
data = PaletteUtil.getPalette(x, y, z, sampler, paletteInfo, paletteLevel).get(paletteLevel, cx, y, cz,
seed);
chunk.setBlock(x, y, z, data);
} else if(paletteInfo.updatePaletteWhenCarving()) {
paletteLevel = 0;
}
paletteLevel++;