World creator height supports

This commit is contained in:
DanLT 2021-06-23 21:12:53 -08:00
parent 0527066a4c
commit 2818b207db

View File

@ -1,17 +1,23 @@
package com.volmit.iris.scaffold;
import com.volmit.iris.Iris;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.object.IrisDimension;
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
import com.volmit.iris.util.FakeWorld;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import java.io.File;
public class IrisWorldCreator
{
private String name;
private boolean studio = false;
private String dimensionName = null;
private long seed = 1337;
private int maxHeight = 256;
private int minHeight = 0;
public IrisWorldCreator()
{
@ -24,9 +30,17 @@ public class IrisWorldCreator
return this;
}
public IrisWorldCreator dimension(IrisDimension dim)
public IrisWorldCreator height(int maxHeight)
{
this.dimensionName = dim.getLoadKey();
this.maxHeight = maxHeight;
this.minHeight = 0;
return this;
}
public IrisWorldCreator height(int minHeight, int maxHeight)
{
this.maxHeight = maxHeight;
this.minHeight = minHeight;
return this;
}
@ -57,6 +71,7 @@ public class IrisWorldCreator
public WorldCreator create()
{
EngineCompositeGenerator g = new EngineCompositeGenerator(dimensionName, !studio);
g.initialize(new FakeWorld(name, minHeight, maxHeight, seed, new File(name), findEnvironment()));
return new WorldCreator(name)
.environment(findEnvironment())
@ -70,6 +85,7 @@ public class IrisWorldCreator
{
return World.Environment.NORMAL;
}
else
{
return dim.getEnvironment();