mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Update pack
This commit is contained in:
parent
c620a9388f
commit
7e9417b186
@ -29,6 +29,7 @@ public class CommandIsh implements CommandExecutor
|
||||
s.sendMessage(ChatColor.DARK_PURPLE + "[" + ChatColor.GRAY + "Iris" + ChatColor.DARK_PURPLE + "]" + ChatColor.GRAY + ": " + msg);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ import ninja.bytecode.iris.spec.IrisBiome;
|
||||
import ninja.bytecode.iris.spec.IrisDimension;
|
||||
import ninja.bytecode.iris.spec.IrisPack;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
|
||||
import ninja.bytecode.shuriken.bench.Profiler;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.collections.GSet;
|
||||
@ -48,6 +49,7 @@ public class Iris extends JavaPlugin implements Listener
|
||||
public static GSet<Chunk> refresh = new GSet<>();
|
||||
public static Profiler profiler;
|
||||
public static TaskExecutor genPool;
|
||||
public static TaskExecutor buildPool;
|
||||
public static IrisGenerator gen;
|
||||
public static Settings settings;
|
||||
public static Iris instance;
|
||||
@ -58,6 +60,7 @@ public class Iris extends JavaPlugin implements Listener
|
||||
|
||||
public void onEnable()
|
||||
{
|
||||
PrecisionStopwatch stopwatch = PrecisionStopwatch.start();
|
||||
Direction.calculatePermutations();
|
||||
dimensions = new GMap<>();
|
||||
biomes = new GMap<>();
|
||||
@ -66,6 +69,7 @@ public class Iris extends JavaPlugin implements Listener
|
||||
values = new GMap<>();
|
||||
instance = this;
|
||||
settings = new Settings();
|
||||
buildPool = new TaskExecutor(getTC(), settings.performance.threadPriority, "Iris Compiler");
|
||||
J.attempt(() -> createTempCache());
|
||||
loadContent();
|
||||
processContent();
|
||||
@ -97,6 +101,14 @@ public class Iris extends JavaPlugin implements Listener
|
||||
Bukkit.unloadWorld(i, false);
|
||||
}
|
||||
}
|
||||
|
||||
double ms = stopwatch.getMilliseconds();
|
||||
|
||||
J.a(() ->
|
||||
{
|
||||
J.sleep(5000);
|
||||
L.i("Iris Startup Took " + F.duration(ms, 2));
|
||||
});
|
||||
}
|
||||
|
||||
private void processContent()
|
||||
@ -170,7 +182,6 @@ public class Iris extends JavaPlugin implements Listener
|
||||
L.i("Object Groups: " + schematics.size());
|
||||
L.i("Objects: " + F.f(m));
|
||||
|
||||
|
||||
L.flush();
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@ public class Settings
|
||||
|
||||
public static class PerformanceSettings
|
||||
{
|
||||
public PerformanceMode performanceMode = PerformanceMode.UNLIMITED;
|
||||
public int threadCount = 12;
|
||||
public int threadPriority = Thread.MAX_PRIORITY;
|
||||
public PerformanceMode performanceMode = PerformanceMode.MATCH_CPU;
|
||||
public int threadCount = 1;
|
||||
public int threadPriority = Thread.MIN_PRIORITY;
|
||||
public boolean loadonstart = true;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ public class Settings
|
||||
public double horizontalZoom = 1; // 0.525
|
||||
public double heightFracture = 155;
|
||||
public double landScale = 0.205;
|
||||
public double landChance = 0.529;
|
||||
public double landChance = 0.6;
|
||||
public double roughness = 1.333;
|
||||
public double heightMultiplier = 0.806;
|
||||
public double heightExponentBase = 1;
|
||||
@ -30,7 +30,7 @@ public class Settings
|
||||
public double baseHeight = 0.165;
|
||||
public int seaLevel = 63;
|
||||
public double caveDensity = 1;
|
||||
public double biomeScale = 2.5;
|
||||
public double biomeScale = 2;
|
||||
public boolean flatBedrock = false;
|
||||
public boolean doSchematics = true;
|
||||
}
|
||||
|
@ -55,9 +55,11 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
MB.of(Material.SMOOTH_BRICK, 2),
|
||||
MB.of(Material.SMOOTH_BRICK, 3),
|
||||
});
|
||||
public GMap<String, IrisBiome> biomeCache = new GMap<>();
|
||||
//@done
|
||||
private MB WATER = new MB(Material.STATIONARY_WATER);
|
||||
private MB BEDROCK = new MB(Material.BEDROCK);
|
||||
private GList<IrisBiome> internal;
|
||||
private GenLayerBase glBase;
|
||||
private GenLayerLayeredNoise glLNoise;
|
||||
private GenLayerRidge glRidge;
|
||||
@ -81,13 +83,33 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
public GList<IrisBiome> getLoadedBiomes()
|
||||
{
|
||||
return IrisBiome.getAllBiomes().copy().add(dim.getBiomes());
|
||||
return internal;
|
||||
}
|
||||
|
||||
public IrisGenerator(IrisDimension dim)
|
||||
{
|
||||
this.dim = dim;
|
||||
L.i("Preparing Dimension: " + dim.getName() + " With " + dim.getBiomes().size() + " Biomes...");
|
||||
internal = IrisBiome.getAllBiomes();
|
||||
|
||||
for(IrisBiome i : dim.getBiomes())
|
||||
{
|
||||
for(IrisBiome j : internal.copy())
|
||||
{
|
||||
if(j.getName().equals(i.getName()))
|
||||
{
|
||||
internal.remove(j);
|
||||
L.i("Internal Biome: " + j.getName() + " overwritten by dimension " + dim.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal.addAll(dim.getBiomes());
|
||||
|
||||
for(IrisBiome i : internal)
|
||||
{
|
||||
biomeCache.put(i.getName(), i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -121,6 +143,11 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
return glBiome.getBiome(wx * Iris.settings.gen.biomeScale, wz * Iris.settings.gen.biomeScale);
|
||||
}
|
||||
|
||||
public IrisBiome biome(String name)
|
||||
{
|
||||
return biomeCache.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome genColumn(int wxx, int wzx, int x, int z, ChunkPlan plan)
|
||||
{
|
||||
@ -137,24 +164,19 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
|
||||
if(height > 61 && height < 65)
|
||||
{
|
||||
override = IrisBiome.BEACH;
|
||||
override = biome("Beach");
|
||||
}
|
||||
|
||||
else if(height < 63)
|
||||
{
|
||||
if(height < 36)
|
||||
{
|
||||
override = IrisBiome.DEEP_OCEAN;
|
||||
}
|
||||
|
||||
else if(height < 50)
|
||||
{
|
||||
override = IrisBiome.OCEAN;
|
||||
override = biome("Deep Ocean");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
override = IrisBiome.LAKE;
|
||||
override = biome("Ocean");
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,4 +299,14 @@ public class IrisGenerator extends ParallelChunkGenerator
|
||||
{
|
||||
return world;
|
||||
}
|
||||
|
||||
public GMap<String, SchematicGroup> getSchematicCache()
|
||||
{
|
||||
return schematicCache;
|
||||
}
|
||||
|
||||
public void setSchematicCache(GMap<String, SchematicGroup> schematicCache)
|
||||
{
|
||||
this.schematicCache = schematicCache;
|
||||
}
|
||||
}
|
@ -45,13 +45,13 @@ public class GenLayerBiome extends GenLayer
|
||||
{
|
||||
double x = xx + (fracture.noise(zz, xx) * 1550D);
|
||||
double z = zz - (fracture.noise(xx, zz) * 1550D);
|
||||
IrisBiome cbi = IrisBiome.OCEAN;
|
||||
IrisBiome cbi = iris.biome("Ocean");
|
||||
double land = island.noise(x, z);
|
||||
double landChance = 1D - M.clip(Iris.settings.gen.landChance, 0D, 1D);
|
||||
|
||||
if(land > landChance && land < landChance + 0.0175)
|
||||
{
|
||||
cbi = IrisBiome.BEACH;
|
||||
cbi = iris.biome("Beach");
|
||||
}
|
||||
|
||||
else if(land > landChance + 0.0175)
|
||||
@ -60,7 +60,7 @@ public class GenLayerBiome extends GenLayer
|
||||
{
|
||||
if(biomeGenerator.hasBorder(3, 3 + Math.pow(riverCheck.noise(x, z), 1.25) * 16, x, z))
|
||||
{
|
||||
return IrisBiome.RIVER;
|
||||
return iris.biome("River");
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ public class GenLayerBiome extends GenLayer
|
||||
|
||||
if(pathCheck.noise(x, z) > 0.33)
|
||||
{
|
||||
IrisBiome road = IrisBiome.ROAD_GRAVEL;
|
||||
IrisBiome road = iris.biome("Beach");
|
||||
|
||||
if(cbi.getSurface().get(0).material.equals(Material.GRASS))
|
||||
{
|
||||
@ -84,7 +84,7 @@ public class GenLayerBiome extends GenLayer
|
||||
|
||||
else if(land < 0.3)
|
||||
{
|
||||
cbi = IrisBiome.DEEP_OCEAN;
|
||||
cbi = iris.biome("Deep Ocean");
|
||||
}
|
||||
|
||||
return cbi;
|
||||
|
@ -17,7 +17,9 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.util.Catalyst12;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.iris.util.MB;
|
||||
import ninja.bytecode.iris.util.VectorMath;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.collections.GMap;
|
||||
import ninja.bytecode.shuriken.io.CustomOutputStream;
|
||||
@ -82,7 +84,7 @@ public class Schematic
|
||||
|
||||
mountHeight = avg(avy);
|
||||
mount = new BlockVector(avg(avx), 0, avg(avz));
|
||||
L.i(" Corrected Mount Point: 0,0,0 -> " + mount.getBlockX() + "," + mount.getBlockY() + "," + mount.getBlockZ());
|
||||
L.i("Corrected " + getName() + "'s Mount Point: 0,0,0 -> " + mount.getBlockX() + "," + mount.getBlockY() + "," + mount.getBlockZ());
|
||||
}
|
||||
|
||||
private int avg(double[] v)
|
||||
@ -183,6 +185,7 @@ public class Schematic
|
||||
Schematic s = new Schematic(w, h, d);
|
||||
s.fill(this.s);
|
||||
s.centeredHeight = centeredHeight;
|
||||
s.name = name;
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -203,9 +206,11 @@ public class Schematic
|
||||
return g % 2 == 0 ? m : m + 1;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void place(World source, int wx, int wy, int wz)
|
||||
{
|
||||
Location start = new Location(source, wx, wy, wz).clone().add(sh(w), sh(h) + 1, sh(d)).subtract(mount);
|
||||
Location start = new Location(source, wx, wy, wz).clone().add(sh(w), sh(h) + 1, sh(d));
|
||||
start.subtract(mount);
|
||||
int highestY = source.getHighestBlockYAt(start);
|
||||
|
||||
if(start.getBlockY() + mountHeight > highestY)
|
||||
@ -214,12 +219,24 @@ public class Schematic
|
||||
}
|
||||
|
||||
start.add(shift);
|
||||
GMap<Location, MB> undo = new GMap<>();
|
||||
|
||||
for(BlockVector i : getSchematic().k())
|
||||
{
|
||||
MB b = getSchematic().get(i);
|
||||
Location f = start.clone().add(i);
|
||||
|
||||
if(i.getBlockY() == mountHeight && f.clone().subtract(0, 1, 0).getBlock().isLiquid())
|
||||
{
|
||||
for(Location j : undo.k())
|
||||
{
|
||||
Catalyst12.setBlock(source, j.getBlockX(), j.getBlockY(), j.getBlockZ(), undo.get(j));
|
||||
Iris.refresh.add(j.getChunk());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(b.material.equals(Material.SKULL))
|
||||
{
|
||||
continue;
|
||||
@ -228,6 +245,7 @@ public class Schematic
|
||||
try
|
||||
{
|
||||
Iris.refresh.add(f.getChunk());
|
||||
undo.put(f, MB.of(f.getBlock().getType(), f.getBlock().getData()));
|
||||
Catalyst12.setBlock(source, f.getBlockX(), f.getBlockY(), f.getBlockZ(), b);
|
||||
}
|
||||
|
||||
@ -243,7 +261,7 @@ public class Schematic
|
||||
Schematic s = new Schematic(1, 1, 1);
|
||||
s.read(in);
|
||||
|
||||
L.i("Loaded Internal Schematic: " + s.getSchematic().size());
|
||||
L.i("Loaded Internal Object: " + s.getSchematic().size());
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -254,7 +272,7 @@ public class Schematic
|
||||
FileInputStream fin = new FileInputStream(f);
|
||||
s.read(fin);
|
||||
|
||||
L.i("Loaded Schematic: " + f.getPath() + " Size: " + s.getSchematic().size());
|
||||
L.i("Loaded Object: " + f.getPath() + " Size: " + s.getSchematic().size());
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -263,6 +281,19 @@ public class Schematic
|
||||
return name;
|
||||
}
|
||||
|
||||
public void rotate(Direction from, Direction to)
|
||||
{
|
||||
GMap<BlockVector, MB> g = s.copy();
|
||||
s.clear();
|
||||
|
||||
for(BlockVector i : g.k())
|
||||
{
|
||||
s.put(VectorMath.rotate(from, to, i).toBlockVector(), g.get(i));
|
||||
}
|
||||
|
||||
name = name + "-rt" + to.name();
|
||||
}
|
||||
|
||||
public void computeFlag(String j)
|
||||
{
|
||||
try
|
||||
@ -271,7 +302,7 @@ public class Schematic
|
||||
{
|
||||
int downshift = Integer.valueOf(j.split("\\Q=\\E")[1]);
|
||||
shift.subtract(new Vector(0, downshift, 0));
|
||||
L.i(" Sank Object: 0,0,0 -> " + shift.getBlockX() + "," + shift.getBlockY() + "," + shift.getBlockZ());
|
||||
L.i("Corrected " + getName() + "'s Mount Height: 0,0,0 -> " + shift.getBlockX() + "," + shift.getBlockY() + "," + shift.getBlockZ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,12 @@ package ninja.bytecode.iris.schematic;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.util.Direction;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||
import ninja.bytecode.shuriken.io.IO;
|
||||
import ninja.bytecode.shuriken.logging.L;
|
||||
|
||||
@ -78,6 +81,7 @@ public class SchematicGroup
|
||||
|
||||
for(File i : folder.listFiles())
|
||||
{
|
||||
|
||||
if(i.getName().endsWith(".ifl"))
|
||||
{
|
||||
try
|
||||
@ -115,18 +119,46 @@ public class SchematicGroup
|
||||
|
||||
public void processVariants()
|
||||
{
|
||||
GList<Schematic> inject = new GList<>();
|
||||
L.v("Processing " + name + " Objects");
|
||||
L.v("# Creating Rotations for " + getSchematics().size() + " Objects");
|
||||
|
||||
ReentrantLock rr = new ReentrantLock();
|
||||
TaskGroup gg = Iris.buildPool.startWork();
|
||||
for(Schematic i : getSchematics())
|
||||
{
|
||||
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
|
||||
{
|
||||
Schematic cp = i.copy();
|
||||
|
||||
gg.queue(() -> {
|
||||
Schematic f = cp;
|
||||
f.rotate(Direction.N, j);
|
||||
rr.lock();
|
||||
inject.add(f);
|
||||
rr.unlock();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
gg.execute();
|
||||
gg = Iris.buildPool.startWork();
|
||||
|
||||
getSchematics().add(inject);
|
||||
L.v("# Generated " + inject.size() + " Rotated Objects to " + getName());
|
||||
|
||||
for(Schematic i : getSchematics())
|
||||
{
|
||||
L.v("# Processing " + i.getName());
|
||||
L.flush();
|
||||
gg.queue(() -> {
|
||||
i.computeMountShift();
|
||||
|
||||
for(String j : flags)
|
||||
{
|
||||
i.computeFlag(j);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
gg.execute();
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ public class IrisBiome
|
||||
public static final double MIN_HEIGHT = -0.0218;
|
||||
|
||||
//@builder
|
||||
public static final IrisBiome RIVER = new IrisBiome("River", Biome.RIVER)
|
||||
private static final IrisBiome RIVER = new IrisBiome("River", Biome.RIVER)
|
||||
.surface(MB.of(Material.SAND))
|
||||
.coreBiome();
|
||||
public static final IrisBiome BEACH = new IrisBiome("Beach", Biome.BEACHES)
|
||||
private static final IrisBiome BEACH = new IrisBiome("Beach", Biome.BEACHES)
|
||||
.height(-0.078)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND));
|
||||
@ -40,17 +40,12 @@ public class IrisBiome
|
||||
.surface(MB.of(Material.GRASS_PATH))
|
||||
.coreBiome()
|
||||
.scatter(MB.of(Material.TORCH), 0.05);
|
||||
public static final IrisBiome OCEAN = new IrisBiome("Ocean", Biome.OCEAN)
|
||||
private static final IrisBiome OCEAN = new IrisBiome("Ocean", Biome.OCEAN)
|
||||
.height(-0.5)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
.simplexSurface();
|
||||
public static final IrisBiome LAKE = new IrisBiome("Lake", Biome.DESERT)
|
||||
.height(-0.38)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.SAND), MB.of(Material.GRAVEL), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
.simplexSurface();
|
||||
public static final IrisBiome DEEP_OCEAN = new IrisBiome("Deep Ocean", Biome.DEEP_OCEAN)
|
||||
private static final IrisBiome DEEP_OCEAN = new IrisBiome("Deep Ocean", Biome.DEEP_OCEAN)
|
||||
.height(-0.88)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND), MB.of(Material.CLAY), MB.of(Material.GRAVEL))
|
||||
@ -71,6 +66,76 @@ public class IrisBiome
|
||||
private GMap<String, Double> schematicGroups;
|
||||
private PolygonGenerator.EnumPolygonGenerator<MB> poly;
|
||||
|
||||
public static double getMaxHeight()
|
||||
{
|
||||
return MAX_HEIGHT;
|
||||
}
|
||||
|
||||
public static double getIdealHeight()
|
||||
{
|
||||
return IDEAL_HEIGHT;
|
||||
}
|
||||
|
||||
public static double getMinHeight()
|
||||
{
|
||||
return MIN_HEIGHT;
|
||||
}
|
||||
|
||||
public static IrisBiome getRiver()
|
||||
{
|
||||
return RIVER;
|
||||
}
|
||||
|
||||
public static IrisBiome getBeach()
|
||||
{
|
||||
return BEACH;
|
||||
}
|
||||
|
||||
public static IrisBiome getRoadGravel()
|
||||
{
|
||||
return ROAD_GRAVEL;
|
||||
}
|
||||
|
||||
public static IrisBiome getRoadGrassy()
|
||||
{
|
||||
return ROAD_GRASSY;
|
||||
}
|
||||
|
||||
public static IrisBiome getOcean()
|
||||
{
|
||||
return OCEAN;
|
||||
}
|
||||
|
||||
public static IrisBiome getDeepOcean()
|
||||
{
|
||||
return DEEP_OCEAN;
|
||||
}
|
||||
|
||||
public static GMap<Biome, IrisBiome> getMap()
|
||||
{
|
||||
return map;
|
||||
}
|
||||
|
||||
public boolean isScatterSurface()
|
||||
{
|
||||
return scatterSurface;
|
||||
}
|
||||
|
||||
public boolean isCore()
|
||||
{
|
||||
return core;
|
||||
}
|
||||
|
||||
public boolean isSimplexScatter()
|
||||
{
|
||||
return simplexScatter;
|
||||
}
|
||||
|
||||
public PolygonGenerator.EnumPolygonGenerator<MB> getPoly()
|
||||
{
|
||||
return poly;
|
||||
}
|
||||
|
||||
public IrisBiome(JSONObject json)
|
||||
{
|
||||
this("Loading", Biome.OCEAN);
|
||||
@ -99,7 +164,8 @@ public class IrisBiome
|
||||
J.attempt(() -> scatterChance = scatterFromJSON(o.getJSONArray("scatter")));
|
||||
J.attempt(() -> simplexScatter = o.getString("surfaceType").equalsIgnoreCase("simplex"));
|
||||
J.attempt(() -> scatterSurface = o.getString("surfaceType").equalsIgnoreCase("scatter"));
|
||||
J.attempt(() -> {
|
||||
J.attempt(() ->
|
||||
{
|
||||
schematicGroups = strFromJSON(o.getJSONArray("objects"));
|
||||
|
||||
for(String i : schematicGroups.k())
|
||||
@ -374,7 +440,7 @@ public class IrisBiome
|
||||
|
||||
public static GList<IrisBiome> getBiomes()
|
||||
{
|
||||
return map.v().remove(IrisBiome.BEACH, IrisBiome.OCEAN, IrisBiome.DEEP_OCEAN, IrisBiome.LAKE, IrisBiome.ROAD_GRASSY, IrisBiome.ROAD_GRAVEL, IrisBiome.BEACH, IrisBiome.LAKE, IrisBiome.RIVER);
|
||||
return map.v().remove(IrisBiome.BEACH, IrisBiome.OCEAN, IrisBiome.DEEP_OCEAN, IrisBiome.ROAD_GRASSY, IrisBiome.ROAD_GRAVEL, IrisBiome.BEACH, IrisBiome.RIVER);
|
||||
}
|
||||
|
||||
public static GList<IrisBiome> getAllBiomes()
|
||||
|
@ -1,13 +1,14 @@
|
||||
package ninja.bytecode.iris.spec;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||
import ninja.bytecode.shuriken.json.JSONArray;
|
||||
import ninja.bytecode.shuriken.json.JSONException;
|
||||
import ninja.bytecode.shuriken.json.JSONObject;
|
||||
@ -44,6 +45,19 @@ public class IrisDimension
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(o.has("focus"))
|
||||
{
|
||||
String focus = o.getString("focus");
|
||||
|
||||
for(IrisBiome i : biomes.copy())
|
||||
{
|
||||
if(!i.getName().toLowerCase().replaceAll(" ", "_").equals(focus))
|
||||
{
|
||||
biomes.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject toJSON()
|
||||
@ -60,14 +74,23 @@ public class IrisDimension
|
||||
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
|
||||
{
|
||||
GList<IrisBiome> b = new GList<>();
|
||||
TaskGroup g = Iris.buildPool.startWork();
|
||||
ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
for(int i = 0; i < a.length(); i++)
|
||||
{
|
||||
IrisBiome bb = Iris.loadBiome(a.getString(i));
|
||||
Iris.biomes.put(a.getString(i), bb);
|
||||
int ii = i;
|
||||
g.queue(() -> {
|
||||
IrisBiome bb = Iris.loadBiome(a.getString(ii));
|
||||
lock.lock();
|
||||
Iris.biomes.put(a.getString(ii), bb);
|
||||
b.add(bb);
|
||||
lock.unlock();
|
||||
});
|
||||
}
|
||||
|
||||
g.execute();
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
19
src/main/resources/pack/biomes/beach.json
Normal file
19
src/main/resources/pack/biomes/beach.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Beach",
|
||||
"derivative": "BEACHES",
|
||||
"height": -0.078,
|
||||
"surface": [
|
||||
"SAND"
|
||||
],
|
||||
"dirt": [
|
||||
"SAND",
|
||||
"SAND",
|
||||
"SAND",
|
||||
"CLAY",
|
||||
"GRAVEL"
|
||||
],
|
||||
"objects": [
|
||||
"tree/palm/medium=0.35",
|
||||
"tree/palm/small=1.95"
|
||||
]
|
||||
}
|
@ -11,7 +11,6 @@
|
||||
"DEAD_BUSH=0.008"
|
||||
],
|
||||
"objects": [
|
||||
"tree/palm/medium=0.25",
|
||||
"tree/palm/small=2.5"
|
||||
"colossal/dead/massive=0.00023"
|
||||
]
|
||||
}
|
@ -9,5 +9,8 @@
|
||||
],
|
||||
"scatter":[
|
||||
"DEAD_BUSH=0.005"
|
||||
],
|
||||
"objects": [
|
||||
"colossal/dead/massive=0.00023"
|
||||
]
|
||||
}
|
@ -9,5 +9,8 @@
|
||||
],
|
||||
"scatter":[
|
||||
"DEAD_BUSH=0.008"
|
||||
],
|
||||
"objects": [
|
||||
"colossal/willow/dead/supermassive=0.00033"
|
||||
]
|
||||
}
|
@ -8,8 +8,8 @@
|
||||
"objects": [
|
||||
"tree/oak/medium=0.33",
|
||||
"tree/oak/small=2.2",
|
||||
"colossal/oak/massive=0.004",
|
||||
"colossal/oak/superlarge=0.002",
|
||||
"colossal/oak/supermassive=0.001"
|
||||
"colossal/oak/massive=0.001",
|
||||
"colossal/oak/superlarge=0.0004",
|
||||
"colossal/oak/supermassive=0.0001"
|
||||
]
|
||||
}
|
@ -4,5 +4,9 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.23",
|
||||
"LONG_GRASS:2=0.13"
|
||||
],
|
||||
"objects": [
|
||||
"tree/birch/medium=0.33",
|
||||
"tree/birch/small=2.2"
|
||||
]
|
||||
}
|
@ -4,5 +4,9 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.23",
|
||||
"LONG_GRASS:2=0.13"
|
||||
],
|
||||
"objects": [
|
||||
"tree/birch/medium=0.33",
|
||||
"tree/birch/small=2.2"
|
||||
]
|
||||
}
|
@ -19,5 +19,13 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.13"
|
||||
],
|
||||
"surfaceType": "simplex"
|
||||
"surfaceType": "simplex",
|
||||
"objects": [
|
||||
"colossal/dead/fallen/massive=0.0005",
|
||||
"colossal/dead/massive=0.0007",
|
||||
"colossal/dead/tainted/massive=0.0007",
|
||||
"colossal/dead/superlarge=0.0006",
|
||||
"colossal/dead/wilted/supermassive=0.0004",
|
||||
"colossal/dead/supermassive=0.0005"
|
||||
]
|
||||
}
|
@ -4,5 +4,12 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.23",
|
||||
"LONG_GRASS:2=0.13"
|
||||
],
|
||||
"objects": [
|
||||
"tree/oak/medium=0.23",
|
||||
"tree/oak/small=2.5",
|
||||
"colossal/oak/massive=0.001",
|
||||
"colossal/oak/superlarge=0.0004",
|
||||
"colossal/oak/supermassive=0.0001"
|
||||
]
|
||||
}
|
@ -4,5 +4,10 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.13",
|
||||
"LONG_GRASS:2=0.13"
|
||||
],
|
||||
"objects": [
|
||||
"tree/oak/medium=0.11",
|
||||
"tree/oak/small=3.2",
|
||||
"colossal/oak/massive=0.0005"
|
||||
]
|
||||
}
|
@ -4,5 +4,8 @@
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.33",
|
||||
"LONG_GRASS:2=0.02"
|
||||
],
|
||||
"objects": [
|
||||
"colossal/jungle/massive=0.001"
|
||||
]
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Mountains",
|
||||
"height": 0.35,
|
||||
"derivative": "EXTREME_HILLS",
|
||||
"scatter":[
|
||||
"LONG_GRASS:2=0.04"
|
||||
|
@ -9,5 +9,10 @@
|
||||
"surfaceType": "simplex",
|
||||
"scatter": [
|
||||
"LONG_GRASS:2=0.07"
|
||||
],
|
||||
"objects": [
|
||||
"tree/spruce/medium=0.67",
|
||||
"tree/spruce/small=2.7",
|
||||
"tree/spruce/dead/medium=0.09"
|
||||
]
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "Biome Name",
|
||||
"derivative": "PLAINS",
|
||||
"height": 0,
|
||||
"surface": [
|
||||
"GRASS"
|
||||
],
|
||||
"dirt": [
|
||||
"DIRT",
|
||||
"DIRT:1"
|
||||
],
|
||||
"scatter":[
|
||||
"LONG_GRASS:1=0.13"
|
||||
],
|
||||
"surfaceType": "na",
|
||||
"schematics": []
|
||||
}
|
@ -27,6 +27,6 @@
|
||||
"ice_mountains",
|
||||
"redwood_forest",
|
||||
"redwood_forest_hills",
|
||||
"mushroom_island"
|
||||
"beach"
|
||||
]
|
||||
}
|
@ -0,0 +1 @@
|
||||
sink=2
|
@ -0,0 +1 @@
|
||||
sink=6
|
@ -0,0 +1 @@
|
||||
sink=8
|
@ -0,0 +1 @@
|
||||
sink=9
|
@ -0,0 +1 @@
|
||||
sink=6
|
@ -0,0 +1 @@
|
||||
sink=9
|
@ -0,0 +1 @@
|
||||
sink=6
|
@ -0,0 +1 @@
|
||||
sink=8
|
@ -0,0 +1 @@
|
||||
sink=10
|
@ -0,0 +1 @@
|
||||
sink=2
|
Loading…
x
Reference in New Issue
Block a user