mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 11:09:06 +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();
|
||||
|
||||
@@ -93,12 +93,10 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdater, Renderer, Hotloadable {
|
||||
KList<EngineStage> getStages();
|
||||
|
||||
void registerStage(EngineStage stage);
|
||||
|
||||
IrisComplex getComplex();
|
||||
|
||||
EngineMode getMode();
|
||||
|
||||
int getBlockUpdatesPerSecond();
|
||||
|
||||
void printMetrics(CommandSender sender);
|
||||
|
||||
@@ -18,16 +18,59 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
public interface EngineMode {
|
||||
public interface EngineMode extends Staged {
|
||||
void close();
|
||||
|
||||
Engine getEngine();
|
||||
|
||||
default MultiBurst burst()
|
||||
{
|
||||
return getEngine().burst();
|
||||
}
|
||||
|
||||
default EngineStage burst(EngineStage... stages)
|
||||
{
|
||||
return (x, z, blocks, biomes, multicore) -> {
|
||||
BurstExecutor e = burst().burst(stages.length);
|
||||
e.setMulticore(multicore);
|
||||
|
||||
for(EngineStage i : stages)
|
||||
{
|
||||
e.queue(() -> i.generate(x, z, blocks, biomes, multicore));
|
||||
}
|
||||
|
||||
e.complete();
|
||||
};
|
||||
}
|
||||
|
||||
default IrisComplex getComplex()
|
||||
{
|
||||
return getEngine().getComplex();
|
||||
}
|
||||
|
||||
default EngineMantle getMantle()
|
||||
{
|
||||
return getEngine().getMantle();
|
||||
}
|
||||
|
||||
default void generateMatter(int x, int z, boolean multicore) {
|
||||
getMantle().generateMatter(x, z, multicore);
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
void generate(int x, int z, Hunk<BlockData> blocks, Hunk<Biome> biomes, boolean multicore);
|
||||
default void generate(int x, int z, Hunk<BlockData> blocks, Hunk<Biome> biomes, boolean multicore)
|
||||
{
|
||||
for (EngineStage i : getStages()) {
|
||||
i.generate(x, z, blocks, biomes, multicore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
|
||||
public abstract class IrisEngineMode implements EngineMode {
|
||||
private final Engine engine;
|
||||
private final KList<EngineStage> stages;
|
||||
private boolean closed;
|
||||
|
||||
public IrisEngineMode(Engine engine)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.stages = new KList<>();
|
||||
this.closed = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close()
|
||||
{
|
||||
if(closed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
closed = true;
|
||||
dump();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Engine getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KList<EngineStage> getStages() {
|
||||
return stages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStage(EngineStage stage) {
|
||||
stages.add(stage);
|
||||
}
|
||||
}
|
||||
33
src/main/java/com/volmit/iris/engine/framework/Staged.java
Normal file
33
src/main/java/com/volmit/iris/engine/framework/Staged.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
|
||||
public interface Staged {
|
||||
KList<EngineStage> getStages();
|
||||
|
||||
void registerStage(EngineStage stage);
|
||||
|
||||
default void dump()
|
||||
{
|
||||
getStages().forEach(EngineStage::close);
|
||||
getStages().clear();
|
||||
}
|
||||
}
|
||||
39
src/main/java/com/volmit/iris/engine/mode/ModeEnclosure.java
Normal file
39
src/main/java/com/volmit/iris/engine/mode/ModeEnclosure.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.mode;
|
||||
|
||||
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.framework.IrisEngineMode;
|
||||
|
||||
public class ModeEnclosure extends IrisEngineMode implements EngineMode {
|
||||
public ModeEnclosure(Engine engine)
|
||||
{
|
||||
super(engine);
|
||||
var terrain = new IrisTerrainNormalActuator(getEngine());
|
||||
var biome = new IrisBiomeActuator(getEngine());
|
||||
|
||||
registerStage(burst(
|
||||
(x, z, k, p, m) -> terrain.actuate(x, z, k, m),
|
||||
(x, z, k, p, m) -> biome.actuate(x, z, p, m)
|
||||
));
|
||||
}
|
||||
}
|
||||
39
src/main/java/com/volmit/iris/engine/mode/ModeIslands.java
Normal file
39
src/main/java/com/volmit/iris/engine/mode/ModeIslands.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.mode;
|
||||
|
||||
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.framework.IrisEngineMode;
|
||||
|
||||
public class ModeIslands extends IrisEngineMode implements EngineMode {
|
||||
public ModeIslands(Engine engine)
|
||||
{
|
||||
super(engine);
|
||||
var terrain = new IrisTerrainNormalActuator(getEngine());
|
||||
var biome = new IrisBiomeActuator(getEngine());
|
||||
|
||||
registerStage(burst(
|
||||
(x, z, k, p, m) -> terrain.actuate(x, z, k, m),
|
||||
(x, z, k, p, m) -> biome.actuate(x, z, p, m)
|
||||
));
|
||||
}
|
||||
}
|
||||
59
src/main/java/com/volmit/iris/engine/mode/ModeOverworld.java
Normal file
59
src/main/java/com/volmit/iris/engine/mode/ModeOverworld.java
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.mode;
|
||||
|
||||
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisDecorantActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.framework.IrisEngineMode;
|
||||
import com.volmit.iris.engine.modifier.IrisCarveModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisDepositModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPerfectionModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPostModifier;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
public class ModeOverworld extends IrisEngineMode implements EngineMode {
|
||||
public ModeOverworld(Engine engine)
|
||||
{
|
||||
super(engine);
|
||||
var terrain = new IrisTerrainNormalActuator(getEngine());
|
||||
var biome = new IrisBiomeActuator(getEngine());
|
||||
var decorant = new IrisDecorantActuator(getEngine());
|
||||
var cave = new IrisCarveModifier(getEngine());
|
||||
var post = new IrisPostModifier(getEngine());
|
||||
var deposit = new IrisDepositModifier(getEngine());
|
||||
var perfection = new IrisPerfectionModifier(getEngine());
|
||||
|
||||
registerStage(burst(
|
||||
(x, z, k, p, m) -> generateMatter(x >> 4, z >> 4, m),
|
||||
(x, z, k, p, m) -> terrain.actuate(x, z, k, m),
|
||||
(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(burst(
|
||||
(x, z, k, p, m) -> decorant.actuate(x, z, k, m),
|
||||
(x, z, k, p, m) -> post.modify(x, z, k, m),
|
||||
(x, z, k, p, m) -> deposit.modify(x, z, k, m),
|
||||
(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));
|
||||
}
|
||||
}
|
||||
39
src/main/java/com/volmit/iris/engine/mode/ModeSuperFlat.java
Normal file
39
src/main/java/com/volmit/iris/engine/mode/ModeSuperFlat.java
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.mode;
|
||||
|
||||
import com.volmit.iris.engine.actuator.IrisBiomeActuator;
|
||||
import com.volmit.iris.engine.actuator.IrisTerrainNormalActuator;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.framework.IrisEngineMode;
|
||||
|
||||
public class ModeSuperFlat extends IrisEngineMode implements EngineMode {
|
||||
public ModeSuperFlat(Engine engine)
|
||||
{
|
||||
super(engine);
|
||||
var terrain = new IrisTerrainNormalActuator(getEngine());
|
||||
var biome = new IrisBiomeActuator(getEngine());
|
||||
|
||||
registerStage(burst(
|
||||
(x, z, k, p, m) -> terrain.actuate(x, z, k, m),
|
||||
(x, z, k, p, m) -> biome.actuate(x, z, p, m)
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -171,6 +171,9 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@MaxNumber(360)
|
||||
@Desc("You can rotate the input coordinates by an angle. This can make terrain appear more natural (less sharp corners and lines). This literally rotates the entire dimension by an angle. Hint: Try 12 degrees or something not on a 90 or 45 degree angle.")
|
||||
private double dimensionAngleDeg = 0;
|
||||
@Required
|
||||
@Desc("Define the mode of this dimension (required!)")
|
||||
private IrisDimensionMode mode = new IrisDimensionMode();
|
||||
@MinNumber(0)
|
||||
@MaxNumber(8192)
|
||||
@Desc("Coordinate fracturing applies noise to the input coordinates. This creates the 'iris swirls' and wavy features. The distance pushes these waves further into places they shouldnt be. This is a block value multiplier.")
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Snippet;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Snippet("dimension-mode")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Represents a dimensional mode")
|
||||
@Data
|
||||
public class IrisDimensionMode {
|
||||
@Desc("The dimension type")
|
||||
private IrisDimensionModeType type = IrisDimensionModeType.OVERWORLD;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineMode;
|
||||
import com.volmit.iris.engine.mode.ModeEnclosure;
|
||||
import com.volmit.iris.engine.mode.ModeIslands;
|
||||
import com.volmit.iris.engine.mode.ModeOverworld;
|
||||
import com.volmit.iris.engine.mode.ModeSuperFlat;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Desc("The type of dimension this is")
|
||||
public enum IrisDimensionModeType {
|
||||
@Desc("Typical dimensions. Has a fluid height, and all features of a biome based world")
|
||||
OVERWORLD(ModeOverworld::new),
|
||||
|
||||
@Desc("Ultra fast, but very limited in features. Only supports terrain & biomes. No decorations, mobs, objects, or anything of the sort!")
|
||||
SUPERFLAT(ModeSuperFlat::new),
|
||||
|
||||
@Desc("Like the nether, a ceiling & floor carved out")
|
||||
ENCLOSURE(ModeEnclosure::new),
|
||||
|
||||
@Desc("Floating islands of terrain")
|
||||
ISLANDS(ModeIslands::new),
|
||||
;
|
||||
private final Function<Engine, EngineMode> factory;
|
||||
|
||||
IrisDimensionModeType(Function<Engine, EngineMode> factory)
|
||||
{
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
public EngineMode create(Engine e)
|
||||
{
|
||||
return factory.apply(e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user