This commit is contained in:
cyberpwn
2022-09-14 13:30:39 -04:00
parent 2ad9a525bd
commit 60843b3bb9
5 changed files with 49 additions and 27 deletions

View File

@@ -479,12 +479,8 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
fixEnergy();
getEngine().cleanupMantleChunk(e.getX(), e.getZ());
if(generated && !injectBiomes.isEmpty()) {
Position2 p = new Position2(e.getX(), e.getZ());
if(injectBiomes.remove(p)) {
INMS.get().injectBiomesFromMantle(e, getMantle());
}
if(generated) {
INMS.get().injectBiomesFromMantle(e, getMantle());
}
}

View File

@@ -52,30 +52,42 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
@BlockCoordinates
@Override
public void onActuate(int x, int z, Hunk<Biome> h, boolean multicore, ChunkContext context) {
PrecisionStopwatch p = PrecisionStopwatch.start();
try
{
PrecisionStopwatch p = PrecisionStopwatch.start();
for(int xf = 0; xf < h.getWidth(); xf++) {
IrisBiome ib;
for(int zf = 0; zf < h.getDepth(); zf++) {
ib = context.getBiome().get(xf, zf);
int maxHeight = (int) (getComplex().getFluidHeight() + ib.getMaxWithObjectHeight(getData()));
MatterBiomeInject matter = null;
int m = 0;
for(int xf = 0; xf < h.getWidth(); xf++) {
IrisBiome ib;
for(int zf = 0; zf < h.getDepth(); zf++) {
ib = context.getBiome().get(xf, zf);
int maxHeight = (int) (getComplex().getFluidHeight() + ib.getMaxWithObjectHeight(getData()));
MatterBiomeInject matter = null;
if(ib.isCustom()) {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
Object biomeBase = INMS.get().getCustomBiomeBaseHolderFor(getDimension().getLoadKey() + ":" + custom.getId());
matter = BiomeInjectMatter.get(INMS.get().getTrueBiomeBaseId(biomeBase));
} else {
Biome v = ib.getSkyBiome(rng, x, 0, z);
matter = BiomeInjectMatter.get(v);
}
if(ib.isCustom()) {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
matter = BiomeInjectMatter.get(INMS.get().getBiomeBaseIdForKey(getDimension().getLoadKey() + ":" + custom.getId()));
} else {
Biome v = ib.getSkyBiome(rng, x, 0, z);
matter = BiomeInjectMatter.get(v);
}
for(int i = 0; i < maxHeight; i++) {
getEngine().getMantle().getMantle().set(x, i, z, matter);
m++;
}
for(int i = 0; i < maxHeight; i++) {
getEngine().getMantle().getMantle().set(x, i, z, matter);
}
}
getEngine().getMetrics().getBiome().put(p.getMilliseconds());
Iris.info("Biome Actuator: " + p.getMilliseconds() + "ms");
Iris.info("Mantle: " + m + " blocks");
}
getEngine().getMetrics().getBiome().put(p.getMilliseconds());
catch(Throwable e)
{
e.printStackTrace();
}
}
}