mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Clean up plax gen
This commit is contained in:
parent
ab4bee5d69
commit
a4a8678116
@ -230,9 +230,25 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
getAccelerant().queue(key, () ->
|
getAccelerant().queue(key, () ->
|
||||||
{
|
{
|
||||||
IrisBiome b = sampleTrueBiome((i * 16) + 7, (j * 16) + 7);
|
IrisBiome b = sampleTrueBiome((i * 16) + 7, (j * 16) + 7);
|
||||||
|
IrisRegion r = sampleRegion((i * 16) + 7, (j * 16) + 7);
|
||||||
RNG ro = getMasterRandom().nextParallelRNG(496888 + i + j);
|
RNG ro = getMasterRandom().nextParallelRNG(496888 + i + j);
|
||||||
int g = 1;
|
int g = 1;
|
||||||
|
g = placeMutations(ro, random, i, j, g);
|
||||||
|
g = placeText(random, r, b, i, j, g);
|
||||||
|
g = placeObjects(random, r, b, i, j, g);
|
||||||
|
g = placeCaveObjects(ro, random, i, j, g);
|
||||||
|
g = placeStructures(randomx, r, b, i, j, g);
|
||||||
|
});
|
||||||
|
|
||||||
|
getParallaxChunk(ii, jj).setParallaxGenerated(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getAccelerant().waitFor(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int placeMutations(RNG ro, RNG random, int i, int j, int g)
|
||||||
|
{
|
||||||
searching: for(IrisBiomeMutation k : getDimension().getMutations())
|
searching: for(IrisBiomeMutation k : getDimension().getMutations())
|
||||||
{
|
{
|
||||||
for(int l = 0; l < k.getChecks(); l++)
|
for(int l = 0; l < k.getChecks(); l++)
|
||||||
@ -249,8 +265,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
{
|
{
|
||||||
for(IrisObjectPlacement m : k.getObjects())
|
for(IrisObjectPlacement m : k.getObjects())
|
||||||
{
|
{
|
||||||
int gg = g++;
|
placeObject(m, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 1569962));
|
||||||
placeObject(m, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1569962));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continue searching;
|
continue searching;
|
||||||
@ -258,31 +273,51 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IrisRegion r = sampleRegion((i * 16) + 7, (j * 16) + 7);
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int placeText(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g)
|
||||||
|
{
|
||||||
for(IrisTextPlacement k : getDimension().getText())
|
for(IrisTextPlacement k : getDimension().getText())
|
||||||
{
|
{
|
||||||
k.place(this, random.nextParallelRNG(-7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
k.place(this, random.nextParallelRNG(g++ + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisTextPlacement k : r.getText())
|
for(IrisTextPlacement k : r.getText())
|
||||||
{
|
{
|
||||||
k.place(this, random.nextParallelRNG(-4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
k.place(this, random.nextParallelRNG(g++ + -4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisTextPlacement k : b.getText())
|
for(IrisTextPlacement k : b.getText())
|
||||||
{
|
{
|
||||||
k.place(this, random.nextParallelRNG(-22228 + -4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
k.place(this, random.nextParallelRNG(g++ + -22228 + -4228 + -7228 + (34 * ((i * 30) + (j * 30)) * i * j) + i - j + 1569962), i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int placeObjects(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g)
|
||||||
|
{
|
||||||
for(IrisObjectPlacement k : b.getObjects())
|
for(IrisObjectPlacement k : b.getObjects())
|
||||||
{
|
{
|
||||||
int gg = g++;
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
||||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 3569222));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getDimension().isCaves())
|
for(IrisObjectPlacement k : r.getObjects())
|
||||||
{
|
{
|
||||||
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
||||||
|
}
|
||||||
|
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int placeCaveObjects(RNG ro, RNG random, int i, int j, int g)
|
||||||
|
{
|
||||||
|
if(!getDimension().isCaves())
|
||||||
|
{
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
|
||||||
int bx = (i * 16) + ro.nextInt(16);
|
int bx = (i * 16) + ro.nextInt(16);
|
||||||
int bz = (j * 16) + ro.nextInt(16);
|
int bz = (j * 16) + ro.nextInt(16);
|
||||||
|
|
||||||
@ -290,12 +325,12 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
|
|
||||||
if(biome == null)
|
if(biome == null)
|
||||||
{
|
{
|
||||||
return;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(biome.getObjects().isEmpty())
|
if(biome.getObjects().isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisObjectPlacement k : biome.getObjects())
|
for(IrisObjectPlacement k : biome.getObjects())
|
||||||
@ -303,25 +338,23 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
|||||||
int gg = g++;
|
int gg = g++;
|
||||||
placeCaveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1869322));
|
placeCaveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + gg) * i * j) + i - j + 1869322));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int placeStructures(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g)
|
||||||
|
{
|
||||||
for(IrisStructurePlacement k : r.getStructures())
|
for(IrisStructurePlacement k : r.getStructures())
|
||||||
{
|
{
|
||||||
k.place(this, random.nextParallelRNG(2228), i, j);
|
k.place(this, random.nextParallelRNG(2228 * 2 * g++), i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisStructurePlacement k : b.getStructures())
|
for(IrisStructurePlacement k : b.getStructures())
|
||||||
{
|
{
|
||||||
k.place(this, random.nextParallelRNG(-22228), i, j);
|
k.place(this, random.nextParallelRNG(-22228 * 4 * g++), i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
return g;
|
||||||
|
|
||||||
getParallaxChunk(ii, jj).setParallaxGenerated(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getAccelerant().waitFor(key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void placeObject(IrisObjectPlacement o, int x, int z, RNG rng)
|
public void placeObject(IrisObjectPlacement o, int x, int z, RNG rng)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user