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;
|
package com.volmit.iris.scaffold;
|
||||||
|
|
||||||
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.manager.IrisDataManager;
|
import com.volmit.iris.manager.IrisDataManager;
|
||||||
import com.volmit.iris.object.IrisDimension;
|
import com.volmit.iris.object.IrisDimension;
|
||||||
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
|
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
|
||||||
|
import com.volmit.iris.util.FakeWorld;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class IrisWorldCreator
|
public class IrisWorldCreator
|
||||||
{
|
{
|
||||||
private String name;
|
private String name;
|
||||||
private boolean studio = false;
|
private boolean studio = false;
|
||||||
private String dimensionName = null;
|
private String dimensionName = null;
|
||||||
private long seed = 1337;
|
private long seed = 1337;
|
||||||
|
private int maxHeight = 256;
|
||||||
|
private int minHeight = 0;
|
||||||
|
|
||||||
public IrisWorldCreator()
|
public IrisWorldCreator()
|
||||||
{
|
{
|
||||||
@ -24,9 +30,17 @@ public class IrisWorldCreator
|
|||||||
return this;
|
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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +70,8 @@ public class IrisWorldCreator
|
|||||||
|
|
||||||
public WorldCreator create()
|
public WorldCreator create()
|
||||||
{
|
{
|
||||||
EngineCompositeGenerator g = new EngineCompositeGenerator(dimensionName, !studio);
|
EngineCompositeGenerator g = new EngineCompositeGenerator(dimensionName, !studio);
|
||||||
|
g.initialize(new FakeWorld(name, minHeight, maxHeight, seed, new File(name), findEnvironment()));
|
||||||
|
|
||||||
return new WorldCreator(name)
|
return new WorldCreator(name)
|
||||||
.environment(findEnvironment())
|
.environment(findEnvironment())
|
||||||
@ -70,6 +85,7 @@ public class IrisWorldCreator
|
|||||||
{
|
{
|
||||||
return World.Environment.NORMAL;
|
return World.Environment.NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return dim.getEnvironment();
|
return dim.getEnvironment();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user