mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
World creator height supports
This commit is contained in:
parent
0527066a4c
commit
2818b207db
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user