mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-01 23:47:21 +00:00
implement <1 deposit spawn chance
This commit is contained in:
parent
23a0ab23aa
commit
e79e3fbe45
@ -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();
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user