mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-04 06:46:09 +00:00
Modes
This commit is contained in:
@@ -31,12 +31,14 @@ import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineEffects;
|
||||
import com.volmit.iris.engine.framework.EngineMetrics;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.framework.EngineStage;
|
||||
import com.volmit.iris.engine.framework.EngineTarget;
|
||||
import com.volmit.iris.engine.framework.EngineWorldManager;
|
||||
import com.volmit.iris.engine.framework.SeedManager;
|
||||
import com.volmit.iris.engine.framework.WrongEngineBroException;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.mode.ModeOverworld;
|
||||
import com.volmit.iris.engine.modifier.IrisCarveModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisDepositModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPerfectionModifier;
|
||||
@@ -94,6 +96,7 @@ public class IrisEngine implements Engine {
|
||||
private final KList<EngineStage> stages;
|
||||
private final AtomicRollingSequence wallClock;
|
||||
private final int art;
|
||||
private EngineMode mode;
|
||||
private final AtomicCache<IrisEngineData> engineData = new AtomicCache<>();
|
||||
private final AtomicBoolean cleaning;
|
||||
private final ChronoLatch cleanLatch;
|
||||
@@ -167,6 +170,8 @@ public class IrisEngine implements Engine {
|
||||
stages.forEach(EngineStage::close);
|
||||
stages.clear();
|
||||
effects.close();
|
||||
mode.close();
|
||||
|
||||
J.a(() -> new IrisProject(getData().getDataFolder()).updateWorkspace());
|
||||
}
|
||||
|
||||
@@ -178,7 +183,7 @@ public class IrisEngine implements Engine {
|
||||
complex = new IrisComplex(this);
|
||||
execution = new IrisExecutionEnvironment(this);
|
||||
effects = new IrisEngineEffects(this);
|
||||
setupStages();
|
||||
setupMode();
|
||||
J.a(this::computeBiomeMaxes);
|
||||
} catch (Throwable e) {
|
||||
Iris.error("FAILED TO SETUP ENGINE!");
|
||||
@@ -188,25 +193,13 @@ public class IrisEngine implements Engine {
|
||||
Iris.debug("Engine Setup Complete " + getCacheID());
|
||||
}
|
||||
|
||||
private void setupStages() {
|
||||
var terrain = new IrisTerrainNormalActuator(this);
|
||||
var biome = new IrisBiomeActuator(this);
|
||||
var decorant = new IrisDecorantActuator(this);
|
||||
var cave = new IrisCarveModifier(this);
|
||||
var post = new IrisPostModifier(this);
|
||||
var deposit = new IrisDepositModifier(this);
|
||||
var perfection = new IrisPerfectionModifier(this);
|
||||
private void setupMode() {
|
||||
if(mode != null)
|
||||
{
|
||||
mode.close();
|
||||
}
|
||||
|
||||
registerStage((x, z, k, p, m) -> warmupChunk(x >> 4, z >> 4));
|
||||
registerStage((x, z, k, p, m) -> generateMatter(x >> 4, z >> 4, m));
|
||||
registerStage((x, z, k, p, m) -> terrain.actuate(x, z, k, m));
|
||||
registerStage((x, z, k, p, m) -> biome.actuate(x, z, p, m));
|
||||
registerStage((x, z, k, p, m) -> cave.modify(x >> 4, z >> 4, k, m));
|
||||
registerStage((x, z, k, p, m) -> decorant.actuate(x, z, k, m));
|
||||
registerStage((x, z, k, p, m) -> post.modify(x, z, k, m));
|
||||
registerStage((x, z, k, p, m) -> deposit.modify(x, z, k, m));
|
||||
registerStage((x, z, K, p, m) -> getMantle().insertMatter(x >> 4, z >> 4, BlockData.class, K, m));
|
||||
registerStage((x, z, k, p, m) -> perfection.modify(x, z, k, m));
|
||||
mode = getDimension().getMode().getType().create(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,11 +328,6 @@ public class IrisEngine implements Engine {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStage(EngineStage stage) {
|
||||
stages.add(stage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlockUpdatesPerSecond() {
|
||||
return buds.get();
|
||||
|
||||
Reference in New Issue
Block a user