implement <1 deposit spawn chance

This commit is contained in:
Julian Krings 2025-01-04 03:46:08 +01:00
parent 23a0ab23aa
commit e79e3fbe45
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2
2 changed files with 14 additions and 0 deletions

View File

@ -71,7 +71,13 @@ public class IrisDepositModifier extends EngineAssignedModifier<BlockData> {
}
public void generate(IrisDepositGenerator k, Hunk<BlockData> data, RNG rng, int cx, int cz, boolean safe, HeightMap he, ChunkContext context) {
if (k.getSpawnChance() < rng.d())
return;
for (int l = 0; l < rng.i(k.getMinPerChunk(), k.getMaxPerChunk() + 1); l++) {
if (k.getPerClumpSpawnChance() < rng.d())
continue;
IrisObject clump = k.getClump(rng, getData());
int dim = clump.getW();

View File

@ -70,6 +70,14 @@ public class IrisDepositGenerator {
@MaxNumber(2048)
@Desc("The minimum amount of clumps per chunk")
private int minPerChunk = 0;
@MinNumber(0)
@MaxNumber(1)
@Desc("The change of the deposit spawning in a chunk")
private double spawnChance = 1;
@MinNumber(0)
@MaxNumber(1)
@Desc("The change of the a clump spawning in a chunk")
private double perClumpSpawnChance = 1;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The palette of blocks to be used in this deposit generator")