mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Tweaks
This commit is contained in:
parent
451eca0aa9
commit
3a699d34eb
@ -14,19 +14,20 @@ public class Settings
|
|||||||
public int threadPriority = Thread.MAX_PRIORITY;
|
public int threadPriority = Thread.MAX_PRIORITY;
|
||||||
public int threadCount = 4;
|
public int threadCount = 4;
|
||||||
public boolean debugMode = true;
|
public boolean debugMode = true;
|
||||||
public int decorationAccuracy = 1;
|
public int decorationAccuracy = 2;
|
||||||
public int cascadeLimit = 14;
|
|
||||||
public boolean interpolation = true;
|
public boolean interpolation = true;
|
||||||
public boolean surfaceNoise = true;
|
public boolean surfaceNoise = true;
|
||||||
|
public boolean verbose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GeneratorSettings
|
public static class GeneratorSettings
|
||||||
{
|
{
|
||||||
|
public double objectDensity = 1D;
|
||||||
public int hermiteSampleRadius = 4;
|
public int hermiteSampleRadius = 4;
|
||||||
public double horizontalZoom = 2;
|
public double horizontalZoom = 2;
|
||||||
public double heightFracture = 155;
|
public double heightFracture = 155;
|
||||||
public double landScale = 0.5;
|
public double landScale = 0.45;
|
||||||
public double landChance = 0.6;
|
public double landChance = 0.53;
|
||||||
public double biomeEdgeScramble = 0; // 1550D
|
public double biomeEdgeScramble = 0; // 1550D
|
||||||
public double roughness = 1.55;
|
public double roughness = 1.55;
|
||||||
public double heightMultiplier = 0.806;
|
public double heightMultiplier = 0.806;
|
||||||
@ -37,12 +38,12 @@ public class Settings
|
|||||||
public int seaLevel = 63;
|
public int seaLevel = 63;
|
||||||
public double caveDensity = 4;
|
public double caveDensity = 4;
|
||||||
public double caveScale = 1.45;
|
public double caveScale = 1.45;
|
||||||
public double biomeScale = 1.65;
|
public double biomeScale = 1.25;
|
||||||
public boolean flatBedrock = true;
|
public boolean flatBedrock = true;
|
||||||
public boolean genObjects = false;
|
public boolean genObjects = true;
|
||||||
public boolean genCarving = false;
|
public boolean genCarving = true;
|
||||||
public boolean genCaverns = false;
|
public boolean genCaverns = true;
|
||||||
public boolean genCaves = false;
|
public boolean genCaves = true;
|
||||||
public double carvingChance = 0.352;
|
public double carvingChance = 0.352;
|
||||||
public double cavernChance = 0.321;
|
public double cavernChance = 0.321;
|
||||||
public int minCarvingHeight = 75;
|
public int minCarvingHeight = 75;
|
||||||
|
@ -18,6 +18,8 @@ import ninja.bytecode.shuriken.bench.PrecisionStopwatch;
|
|||||||
import ninja.bytecode.shuriken.collections.GList;
|
import ninja.bytecode.shuriken.collections.GList;
|
||||||
import ninja.bytecode.shuriken.collections.GMap;
|
import ninja.bytecode.shuriken.collections.GMap;
|
||||||
import ninja.bytecode.shuriken.execution.J;
|
import ninja.bytecode.shuriken.execution.J;
|
||||||
|
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||||
|
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||||
import ninja.bytecode.shuriken.format.F;
|
import ninja.bytecode.shuriken.format.F;
|
||||||
import ninja.bytecode.shuriken.io.IO;
|
import ninja.bytecode.shuriken.io.IO;
|
||||||
import ninja.bytecode.shuriken.json.JSONException;
|
import ninja.bytecode.shuriken.json.JSONException;
|
||||||
@ -103,12 +105,16 @@ public class PackController implements IrisController
|
|||||||
}
|
}
|
||||||
|
|
||||||
L.v(ChatColor.LIGHT_PURPLE + "Processing Content");
|
L.v(ChatColor.LIGHT_PURPLE + "Processing Content");
|
||||||
|
TaskExecutor executor = new TaskExecutor(Runtime.getRuntime().availableProcessors() * 2, Thread.MIN_PRIORITY, "Schematic Processor");
|
||||||
|
TaskGroup gx = executor.startWork();
|
||||||
for(GenObjectGroup i : genObjectGroups.v())
|
for(GenObjectGroup i : genObjectGroups.v())
|
||||||
{
|
{
|
||||||
i.processVariants();
|
gx.queue(i::processVariants);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gx.execute();
|
||||||
|
executor.close();
|
||||||
|
|
||||||
for(String i : dimensions.k())
|
for(String i : dimensions.k())
|
||||||
{
|
{
|
||||||
IrisDimension id = dimensions.get(i);
|
IrisDimension id = dimensions.get(i);
|
||||||
|
@ -11,7 +11,6 @@ import org.bukkit.generator.BlockPopulator;
|
|||||||
import ninja.bytecode.iris.Iris;
|
import ninja.bytecode.iris.Iris;
|
||||||
import ninja.bytecode.iris.controller.PackController;
|
import ninja.bytecode.iris.controller.PackController;
|
||||||
import ninja.bytecode.iris.generator.genobject.GenObjectDecorator;
|
import ninja.bytecode.iris.generator.genobject.GenObjectDecorator;
|
||||||
import ninja.bytecode.iris.generator.layer.BiomeNoiseGenerator;
|
|
||||||
import ninja.bytecode.iris.generator.layer.GenLayerBiome;
|
import ninja.bytecode.iris.generator.layer.GenLayerBiome;
|
||||||
import ninja.bytecode.iris.generator.layer.GenLayerCarving;
|
import ninja.bytecode.iris.generator.layer.GenLayerCarving;
|
||||||
import ninja.bytecode.iris.generator.layer.GenLayerCaverns;
|
import ninja.bytecode.iris.generator.layer.GenLayerCaverns;
|
||||||
@ -67,7 +66,6 @@ public class IrisGenerator extends ParallelChunkGenerator
|
|||||||
private GenLayerCarving glCarving;
|
private GenLayerCarving glCarving;
|
||||||
private GenLayerCaverns glCaverns;
|
private GenLayerCaverns glCaverns;
|
||||||
private GenLayerSnow glSnow;
|
private GenLayerSnow glSnow;
|
||||||
private BiomeNoiseGenerator glBase;
|
|
||||||
private GenLayerCliffs glCliffs;
|
private GenLayerCliffs glCliffs;
|
||||||
private RNG rTerrain;
|
private RNG rTerrain;
|
||||||
private CompiledDimension dim;
|
private CompiledDimension dim;
|
||||||
@ -145,7 +143,17 @@ public class IrisGenerator extends ParallelChunkGenerator
|
|||||||
|
|
||||||
public IrisBiome getBiome(int wxx, int wzx)
|
public IrisBiome getBiome(int wxx, int wzx)
|
||||||
{
|
{
|
||||||
return glBiome.getBiome(wxx, wzx);
|
IrisBiome biome = glBiome.getBiome(wxx, wzx);
|
||||||
|
IrisBiome real = glBiome.getBiome(wxx, wzx, true);
|
||||||
|
boolean frozen = getRegion(biome) != null ? getRegion(biome).isFrozen() : false;
|
||||||
|
int height = computeHeight(wxx, wzx, new ChunkPlan(), biome);
|
||||||
|
int max = Math.max(height, Iris.settings.gen.seaLevel);
|
||||||
|
IrisBiome nbiome = height < 63 ? getOcean(real, height) : biome;
|
||||||
|
biome = nbiome;
|
||||||
|
biome = height > 61 && height < 65 ? frozen ? biome : getBeach(real) : biome;
|
||||||
|
biome = height > 63 && biome.getType().equals(BiomeType.FLUID) ? getBeach(real) : biome;
|
||||||
|
|
||||||
|
return biome;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IrisBiome biome(String name)
|
public IrisBiome biome(String name)
|
||||||
@ -236,13 +244,10 @@ public class IrisGenerator extends ParallelChunkGenerator
|
|||||||
int highest = 0;
|
int highest = 0;
|
||||||
int seaLevel = Iris.settings.gen.seaLevel;
|
int seaLevel = Iris.settings.gen.seaLevel;
|
||||||
IrisBiome biome = getBiome(wxx, wzx);
|
IrisBiome biome = getBiome(wxx, wzx);
|
||||||
boolean frozen = getRegion(biome) != null ? getRegion(biome).isFrozen() : false;
|
IrisRegion r = getRegion(biome);
|
||||||
|
boolean frozen = r != null && r.isFrozen();
|
||||||
int height = computeHeight(wxx, wzx, plan, biome);
|
int height = computeHeight(wxx, wzx, plan, biome);
|
||||||
int max = Math.max(height, seaLevel);
|
int max = Math.max(height, seaLevel);
|
||||||
IrisBiome nbiome = height < 63 ? getOcean(biome, height) : biome;
|
|
||||||
biome = nbiome;
|
|
||||||
biome = height > 61 && height < 65 ? frozen ? biome : getBeach(biome) : biome;
|
|
||||||
biome = height > 63 && biome.getType().equals(BiomeType.FLUID) ? getBeach(biome) : biome;
|
|
||||||
|
|
||||||
for(int i = 0; i < max; i++)
|
for(int i = 0; i < max; i++)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,9 @@ import org.bukkit.util.BlockVector;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mortar.compute.math.M;
|
import mortar.compute.math.M;
|
||||||
|
import mortar.logic.format.F;
|
||||||
|
import mortar.util.text.C;
|
||||||
|
import ninja.bytecode.iris.Iris;
|
||||||
import ninja.bytecode.iris.generator.placer.NMSPlacer;
|
import ninja.bytecode.iris.generator.placer.NMSPlacer;
|
||||||
import ninja.bytecode.iris.util.Direction;
|
import ninja.bytecode.iris.util.Direction;
|
||||||
import ninja.bytecode.iris.util.IPlacer;
|
import ninja.bytecode.iris.util.IPlacer;
|
||||||
@ -225,17 +228,17 @@ public class GenObject
|
|||||||
return g % 2 == 0 ? m : m + 1;
|
return g % 2 == 0 ? m : m + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(Location l)
|
public Location place(Location l)
|
||||||
{
|
{
|
||||||
place(l, new NMSPlacer(l.getWorld()));
|
return place(l, new NMSPlacer(l.getWorld()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(Location l, IPlacer placer)
|
public Location place(Location l, IPlacer placer)
|
||||||
{
|
{
|
||||||
place(l.getBlockX(), l.getBlockY(), l.getBlockZ(), placer);
|
return place(l.getBlockX(), l.getBlockY(), l.getBlockZ(), placer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(int wx, int wy, int wz, IPlacer placer)
|
public Location place(int wx, int wy, int wz, IPlacer placer)
|
||||||
{
|
{
|
||||||
Location start = new Location(placer.getWorld(), wx, wy, wz).clone().add(sh(w), sh(h) + 1, sh(d));
|
Location start = new Location(placer.getWorld(), wx, wy, wz).clone().add(sh(w), sh(h) + 1, sh(d));
|
||||||
|
|
||||||
@ -275,7 +278,12 @@ public class GenObject
|
|||||||
placer.set(j, undo.get(j));
|
placer.set(j, undo.get(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
if(Iris.settings.performance.verbose)
|
||||||
|
{
|
||||||
|
L.w(C.WHITE + "Object " + C.YELLOW + getName() + C.WHITE + " failed to place in " + C.YELLOW + m.toString().toLowerCase() + C.WHITE + " at " + C.YELLOW + F.f(f.getBlockX()) + " " + F.f(f.getBlockY()) + " " + F.f(f.getBlockZ()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(b.material.equals(Material.SKULL))
|
if(b.material.equals(Material.SKULL))
|
||||||
@ -294,6 +302,8 @@ public class GenObject
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GenObject load(InputStream in) throws IOException
|
public static GenObject load(InputStream in) throws IOException
|
||||||
|
@ -3,12 +3,15 @@ package ninja.bytecode.iris.generator.genobject;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.generator.BlockPopulator;
|
import org.bukkit.generator.BlockPopulator;
|
||||||
|
|
||||||
|
import mortar.logic.format.F;
|
||||||
|
import mortar.util.text.C;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import ninja.bytecode.iris.Iris;
|
import ninja.bytecode.iris.Iris;
|
||||||
import ninja.bytecode.iris.controller.TimingsController;
|
import ninja.bytecode.iris.controller.TimingsController;
|
||||||
@ -38,7 +41,7 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
for(IrisBiome i : generator.getDimension().getBiomes())
|
for(IrisBiome i : generator.getDimension().getBiomes())
|
||||||
{
|
{
|
||||||
GMap<GenObjectGroup, Double> gc = new GMap<>();
|
GMap<GenObjectGroup, Double> gc = new GMap<>();
|
||||||
|
int ff = 0;
|
||||||
for(String j : i.getSchematicGroups().k())
|
for(String j : i.getSchematicGroups().k())
|
||||||
{
|
{
|
||||||
double c = i.getSchematicGroups().get(j);
|
double c = i.getSchematicGroups().get(j);
|
||||||
@ -46,7 +49,7 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
GenObjectGroup g = generator.getDimension().getObjectGroup(j);
|
GenObjectGroup g = generator.getDimension().getObjectGroup(j);
|
||||||
|
ff += g.size();
|
||||||
gc.put(g, c);
|
gc.put(g, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +63,11 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
if(!gc.isEmpty())
|
if(!gc.isEmpty())
|
||||||
{
|
{
|
||||||
populationCache.put(i, gc);
|
populationCache.put(i, gc);
|
||||||
|
|
||||||
|
if(Iris.settings.performance.verbose)
|
||||||
|
{
|
||||||
|
L.v(C.DARK_GREEN + i.getName() + ": " + C.DARK_AQUA + F.f(ff) + " Objects");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,7 +85,7 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
{
|
{
|
||||||
int x = (source.getX() << 4) + random.nextInt(16);
|
int x = (source.getX() << 4) + random.nextInt(16);
|
||||||
int z = (source.getZ() << 4) + random.nextInt(16);
|
int z = (source.getZ() << 4) + random.nextInt(16);
|
||||||
IrisBiome biome = g.getBiome(x, z);
|
IrisBiome biome = g.getBiome((int) g.getOffsetX(x), (int) g.getOffsetX(z));
|
||||||
|
|
||||||
if(hits.contains(biome))
|
if(hits.contains(biome))
|
||||||
{
|
{
|
||||||
@ -102,6 +110,11 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Iris.settings.performance.verbose)
|
||||||
|
{
|
||||||
|
L.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populate(World world, Random random, Chunk source, IrisBiome biome, GMap<GenObjectGroup, Double> objects)
|
private void populate(World world, Random random, Chunk source, IrisBiome biome, GMap<GenObjectGroup, Double> objects)
|
||||||
@ -109,6 +122,8 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
for(GenObjectGroup i : objects.k())
|
for(GenObjectGroup i : objects.k())
|
||||||
{
|
{
|
||||||
for(int j = 0; j < getTries(objects.get(i)); j++)
|
for(int j = 0; j < getTries(objects.get(i)); j++)
|
||||||
|
{
|
||||||
|
if(M.r(Iris.settings.gen.objectDensity))
|
||||||
{
|
{
|
||||||
int x = (source.getX() << 4) + random.nextInt(16);
|
int x = (source.getX() << 4) + random.nextInt(16);
|
||||||
int z = (source.getZ() << 4) + random.nextInt(16);
|
int z = (source.getZ() << 4) + random.nextInt(16);
|
||||||
@ -133,7 +148,14 @@ public class GenObjectDecorator extends BlockPopulator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i.getSchematics().get(random.nextInt(i.getSchematics().size())).place(x, b.getY(), z, placer);
|
GenObject g = i.getSchematics().get(random.nextInt(i.getSchematics().size()));
|
||||||
|
Location start = g.place(x, b.getY(), z, placer);
|
||||||
|
|
||||||
|
if(start != null && Iris.settings.performance.verbose)
|
||||||
|
{
|
||||||
|
L.v(C.GRAY + "Placed " + C.DARK_GREEN + i.getName() + C.WHITE + "/" + C.DARK_GREEN + g.getName() + C.GRAY + " at " + C.DARK_GREEN + F.f(start.getBlockX()) + " " + F.f(start.getBlockY()) + " " + F.f(start.getBlockZ()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import java.io.DataInputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
@ -196,25 +195,29 @@ public class GenObjectGroup
|
|||||||
|
|
||||||
public void processVariants()
|
public void processVariants()
|
||||||
{
|
{
|
||||||
|
TaskExecutor te = new TaskExecutor(Runtime.getRuntime().availableProcessors(), Thread.MAX_PRIORITY, "Variant Processor");
|
||||||
|
TaskGroup g = te.startWork();
|
||||||
GList<GenObject> inject = new GList<>();
|
GList<GenObject> inject = new GList<>();
|
||||||
String x = Thread.currentThread().getName();
|
|
||||||
ReentrantLock rr = new ReentrantLock();
|
|
||||||
for(GenObject i : getSchematics())
|
for(GenObject i : getSchematics())
|
||||||
{
|
{
|
||||||
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
|
for(Direction j : new Direction[] {Direction.S, Direction.E, Direction.W})
|
||||||
|
{
|
||||||
|
g.queue(() ->
|
||||||
{
|
{
|
||||||
GenObject cp = i.copy();
|
GenObject cp = i.copy();
|
||||||
GenObject f = cp;
|
GenObject f = cp;
|
||||||
f.rotate(Direction.N, j);
|
f.rotate(Direction.N, j);
|
||||||
rr.lock();
|
|
||||||
inject.add(f);
|
inject.add(f);
|
||||||
rr.unlock();
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g.execute();
|
||||||
getSchematics().add(inject);
|
getSchematics().add(inject);
|
||||||
|
g = te.startWork();
|
||||||
for(GenObject i : getSchematics())
|
for(GenObject i : getSchematics())
|
||||||
|
{
|
||||||
|
g.queue(() ->
|
||||||
{
|
{
|
||||||
i.recalculateMountShift();
|
i.recalculateMountShift();
|
||||||
|
|
||||||
@ -222,8 +225,12 @@ public class GenObjectGroup
|
|||||||
{
|
{
|
||||||
i.computeFlag(j);
|
i.computeFlag(j);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g.execute();
|
||||||
|
te.close();
|
||||||
|
|
||||||
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + F.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
|
L.i(ChatColor.LIGHT_PURPLE + "Processed " + ChatColor.WHITE + F.f(schematics.size()) + ChatColor.LIGHT_PURPLE + " Schematics in " + ChatColor.WHITE + name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package ninja.bytecode.iris.generator.layer;
|
package ninja.bytecode.iris.generator.layer;
|
||||||
|
|
||||||
import ninja.bytecode.iris.pack.IrisBiome;
|
import ninja.bytecode.iris.pack.IrisBiome;
|
||||||
import ninja.bytecode.iris.util.GenLayer;
|
|
||||||
import ninja.bytecode.shuriken.math.CNG;
|
import ninja.bytecode.shuriken.math.CNG;
|
||||||
import ninja.bytecode.shuriken.math.RNG;
|
import ninja.bytecode.shuriken.math.RNG;
|
||||||
|
|
||||||
|
@ -123,11 +123,22 @@ public class GenLayerBiome extends GenLayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IrisBiome getBiome(double wxx, double wzx)
|
public IrisBiome getBiome(double wxx, double wzx)
|
||||||
|
{
|
||||||
|
return getBiome(wxx, wzx, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IrisBiome getBiome(double wxx, double wzx, boolean real)
|
||||||
{
|
{
|
||||||
double wx = Math.round((double) wxx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
double wx = Math.round((double) wxx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
||||||
double wz = Math.round((double) wzx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
double wz = Math.round((double) wzx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
|
||||||
double x = wx + (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wz, wx) * Iris.settings.gen.biomeEdgeScramble));
|
double x = wx + (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wz, wx) * Iris.settings.gen.biomeEdgeScramble));
|
||||||
double z = wz - (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wx, wz) * Iris.settings.gen.biomeEdgeScramble));
|
double z = wz - (Iris.settings.gen.biomeEdgeScramble == 0 ? 0 : (fracture.noise(wx, wz) * Iris.settings.gen.biomeEdgeScramble));
|
||||||
|
|
||||||
|
if(real)
|
||||||
|
{
|
||||||
|
return getRegionGenerator(x, z).getChoice(x, z);
|
||||||
|
}
|
||||||
|
|
||||||
IrisBiome cbi = iris.biome("Ocean");
|
IrisBiome cbi = iris.biome("Ocean");
|
||||||
double land = island.noise(x, z);
|
double land = island.noise(x, z);
|
||||||
double landChance = 1D - M.clip(Iris.settings.gen.landChance, 0D, 1D);
|
double landChance = 1D - M.clip(Iris.settings.gen.landChance, 0D, 1D);
|
||||||
|
@ -934,7 +934,6 @@ public class IrisBiome
|
|||||||
{
|
{
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((bng == null) ? 0 : bng.hashCode());
|
|
||||||
long temp;
|
long temp;
|
||||||
temp = Double.doubleToLongBits(cliffChance);
|
temp = Double.doubleToLongBits(cliffChance);
|
||||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
@ -956,9 +955,6 @@ public class IrisBiome
|
|||||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||||
result = prime * result + ((parent == null) ? 0 : parent.hashCode());
|
result = prime * result + ((parent == null) ? 0 : parent.hashCode());
|
||||||
result = prime * result + ((poly == null) ? 0 : poly.hashCode());
|
|
||||||
result = prime * result + ((polyRock == null) ? 0 : polyRock.hashCode());
|
|
||||||
result = prime * result + ((polySub == null) ? 0 : polySub.hashCode());
|
|
||||||
result = prime * result + ((realBiome == null) ? 0 : realBiome.hashCode());
|
result = prime * result + ((realBiome == null) ? 0 : realBiome.hashCode());
|
||||||
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
result = prime * result + ((region == null) ? 0 : region.hashCode());
|
||||||
result = prime * result + ((rock == null) ? 0 : rock.hashCode());
|
result = prime * result + ((rock == null) ? 0 : rock.hashCode());
|
||||||
@ -994,13 +990,6 @@ public class IrisBiome
|
|||||||
if(getClass() != obj.getClass())
|
if(getClass() != obj.getClass())
|
||||||
return false;
|
return false;
|
||||||
IrisBiome other = (IrisBiome) obj;
|
IrisBiome other = (IrisBiome) obj;
|
||||||
if(bng == null)
|
|
||||||
{
|
|
||||||
if(other.bng != null)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(!bng.equals(other.bng))
|
|
||||||
return false;
|
|
||||||
if(Double.doubleToLongBits(cliffChance) != Double.doubleToLongBits(other.cliffChance))
|
if(Double.doubleToLongBits(cliffChance) != Double.doubleToLongBits(other.cliffChance))
|
||||||
return false;
|
return false;
|
||||||
if(Double.doubleToLongBits(cliffScale) != Double.doubleToLongBits(other.cliffScale))
|
if(Double.doubleToLongBits(cliffScale) != Double.doubleToLongBits(other.cliffScale))
|
||||||
@ -1042,27 +1031,6 @@ public class IrisBiome
|
|||||||
}
|
}
|
||||||
else if(!parent.equals(other.parent))
|
else if(!parent.equals(other.parent))
|
||||||
return false;
|
return false;
|
||||||
if(poly == null)
|
|
||||||
{
|
|
||||||
if(other.poly != null)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(!poly.equals(other.poly))
|
|
||||||
return false;
|
|
||||||
if(polyRock == null)
|
|
||||||
{
|
|
||||||
if(other.polyRock != null)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(!polyRock.equals(other.polyRock))
|
|
||||||
return false;
|
|
||||||
if(polySub == null)
|
|
||||||
{
|
|
||||||
if(other.polySub != null)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(!polySub.equals(other.polySub))
|
|
||||||
return false;
|
|
||||||
if(realBiome != other.realBiome)
|
if(realBiome != other.realBiome)
|
||||||
return false;
|
return false;
|
||||||
if(region == null)
|
if(region == null)
|
||||||
|
@ -8,6 +8,8 @@ import ninja.bytecode.iris.Iris;
|
|||||||
import ninja.bytecode.iris.controller.PackController;
|
import ninja.bytecode.iris.controller.PackController;
|
||||||
import ninja.bytecode.shuriken.collections.GList;
|
import ninja.bytecode.shuriken.collections.GList;
|
||||||
import ninja.bytecode.shuriken.execution.J;
|
import ninja.bytecode.shuriken.execution.J;
|
||||||
|
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||||
|
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||||
import ninja.bytecode.shuriken.json.JSONArray;
|
import ninja.bytecode.shuriken.json.JSONArray;
|
||||||
import ninja.bytecode.shuriken.json.JSONException;
|
import ninja.bytecode.shuriken.json.JSONException;
|
||||||
import ninja.bytecode.shuriken.json.JSONObject;
|
import ninja.bytecode.shuriken.json.JSONObject;
|
||||||
@ -65,14 +67,21 @@ public class IrisDimension
|
|||||||
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
|
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
|
||||||
{
|
{
|
||||||
GList<IrisBiome> b = new GList<>();
|
GList<IrisBiome> b = new GList<>();
|
||||||
|
TaskExecutor t = new TaskExecutor(Runtime.getRuntime().availableProcessors() * 2, Thread.MIN_PRIORITY, "Biome Loader");
|
||||||
|
TaskGroup g = t.startWork();
|
||||||
for(int i = 0; i < a.length(); i++)
|
for(int i = 0; i < a.length(); i++)
|
||||||
{
|
{
|
||||||
int ii = i;
|
int ii = i;
|
||||||
|
|
||||||
|
g.queue(() ->
|
||||||
|
{
|
||||||
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
|
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
|
||||||
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
|
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
|
||||||
b.add(bb);
|
b.add(bb);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
g.execute();
|
||||||
|
t.close();
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import org.bukkit.generator.ChunkGenerator;
|
|||||||
import ninja.bytecode.iris.Iris;
|
import ninja.bytecode.iris.Iris;
|
||||||
import ninja.bytecode.iris.controller.ExecutionController;
|
import ninja.bytecode.iris.controller.ExecutionController;
|
||||||
import ninja.bytecode.iris.controller.TimingsController;
|
import ninja.bytecode.iris.controller.TimingsController;
|
||||||
import ninja.bytecode.shuriken.execution.ChronoLatch;
|
|
||||||
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
import ninja.bytecode.shuriken.execution.TaskExecutor;
|
||||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
|
||||||
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskResult;
|
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskResult;
|
||||||
@ -29,7 +28,6 @@ public abstract class ParallelChunkGenerator extends ChunkGenerator
|
|||||||
private TaskGroup tg;
|
private TaskGroup tg;
|
||||||
private boolean ready = false;
|
private boolean ready = false;
|
||||||
int cg = 0;
|
int cg = 0;
|
||||||
private ChronoLatch cl = new ChronoLatch(1000);
|
|
||||||
private RollingSequence rs = new RollingSequence(512);
|
private RollingSequence rs = new RollingSequence(512);
|
||||||
private World world;
|
private World world;
|
||||||
private TaskExecutor genPool;
|
private TaskExecutor genPool;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user