mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Fix biome issues
This commit is contained in:
parent
c5bd594798
commit
84506c65ad
32
.idea/workspace.xml
generated
32
.idea/workspace.xml
generated
@ -16,8 +16,8 @@
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Enum" />
|
||||
<option value="Class" />
|
||||
<option value="Interface" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@ -60,11 +60,11 @@
|
||||
<recent name="com.volmit.iris.gen.v2.scaffold.stream.sources" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="com.volmit.iris.v2.scaffold.hunk.view" />
|
||||
<recent name="com.volmit.iris.v2.scaffold.engine" />
|
||||
<recent name="com.volmit.iris.v2.generator.actuator" />
|
||||
<recent name="com.volmit.iris.v2.scaffold.stream.utility" />
|
||||
<recent name="com.volmit.iris.object" />
|
||||
<recent name="com.volmit.iris.gen.v2.generator.actuator" />
|
||||
<recent name="com.volmit.iris.gen.v2.scaffold.stream.utility" />
|
||||
<recent name="com.volmit.iris.gen.v2.scaffold.stream.arithmetic" />
|
||||
</key>
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\cyberpwn\Documents\development\workspace\Iris\src\main\java\com\volmit\iris\gen\v2\scaffold\hunk" />
|
||||
@ -123,10 +123,10 @@
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state x="410" y="171" width="1234" height="708" key="#com.intellij.execution.impl.EditConfigurationsDialog/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603947263834" />
|
||||
<state x="718" y="163" key="#com.intellij.ide.util.MemberChooser" timestamp="1603972366639">
|
||||
<state x="718" y="163" key="#com.intellij.ide.util.MemberChooser" timestamp="1604058506770">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state x="718" y="163" key="#com.intellij.ide.util.MemberChooser/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603972366639" />
|
||||
<state x="718" y="163" key="#com.intellij.ide.util.MemberChooser/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604058506770" />
|
||||
<state x="675" y="394" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes" timestamp="1603943257126">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
@ -143,22 +143,22 @@
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state x="485" y="234" key="#com.intellij.structuralsearch.plugin.ui.StructuralSearchDialog/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603860057506" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.bottom" timestamp="1604048198954">
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.bottom" timestamp="1604062158493">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.bottom/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604048198954" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.center" timestamp="1604048198953">
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.bottom/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604062158493" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.center" timestamp="1604062158493">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.center/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604048198953" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.left" timestamp="1604048198953">
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.center/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604062158493" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.left" timestamp="1604062158493">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.left/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604048198953" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.right" timestamp="1604048198954">
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.left/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604062158493" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.right" timestamp="1604062158493">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.right/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604048198954" />
|
||||
<state width="1921" height="983" key="GridCell.Tab.0.right/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604062158493" />
|
||||
<state x="312" y="0" key="SettingsEditor" timestamp="1603947206451">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
@ -171,9 +171,9 @@
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state x="532" y="239" key="run.anything.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1603859771295" />
|
||||
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup" timestamp="1604046453193">
|
||||
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup" timestamp="1604060078796">
|
||||
<screen x="0" y="0" width="1920" height="1050" />
|
||||
</state>
|
||||
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604046453193" />
|
||||
<state x="539" y="15" width="840" height="1034" key="search.everywhere.popup/-1920.0.1920.1050/1920.0.1920.1050/0.0.1920.1050@0.0.1920.1050" timestamp="1604060078796" />
|
||||
</component>
|
||||
</project>
|
@ -25,6 +25,6 @@ public class TestGen
|
||||
public static void gen(Player p)
|
||||
{
|
||||
p.teleport(new Location(new WorldCreator("t/" + UUID.randomUUID().toString())
|
||||
.generator(EngineCompositeGenerator.newStudioWorld("test")).createWorld(), 0, 70, 0));
|
||||
.generator(EngineCompositeGenerator.newStudioWorld("overworld")).createWorld(), 0, 70, 0));
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.volmit.iris.v2.scaffold.engine.Engine;
|
||||
import com.volmit.iris.v2.scaffold.engine.EngineFramework;
|
||||
import com.volmit.iris.v2.scaffold.engine.EngineTarget;
|
||||
import com.volmit.iris.v2.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.v2.scaffold.parallel.MultiBurst;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bukkit.block.Biome;
|
||||
@ -31,8 +32,14 @@ public class IrisEngine implements Engine
|
||||
|
||||
@Override
|
||||
public void generate(int x, int z, Hunk<BlockData> blocks, Hunk<Biome> biomes) {
|
||||
getFramework().getTerrainActuator().actuate(x, z, blocks);
|
||||
getFramework().getDecorantActuator().actuate(x, z, blocks);
|
||||
getFramework().getBiomeActuator().actuate(x, z, biomes);
|
||||
MultiBurst.burst.burst(
|
||||
() -> blocks.compute2D(getParallelism(), (xx,yy,zz, b) -> {
|
||||
getFramework().getTerrainActuator().actuate(x+xx, z+zz, b);
|
||||
getFramework().getDecorantActuator().actuate(x+xx, z+zz, b);
|
||||
}),
|
||||
()->biomes.compute2D(getParallelism(), (xx,yy,zz,b) -> {
|
||||
getFramework().getBiomeActuator().actuate(x+xx, z+zz, b);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActuate(int x, int z, Hunk<Biome> output) {
|
||||
output.compute2D(getParallelism(), (xx, yy, zz, h) -> {
|
||||
public void onActuate(int x, int z, Hunk<Biome> h) {
|
||||
int i,zf;
|
||||
Biome v;
|
||||
|
||||
@ -21,14 +20,13 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome>
|
||||
{
|
||||
for(zf = 0; zf < h.getDepth(); zf++)
|
||||
{
|
||||
v = getComplex().getTrueBiomeDerivativeStream().get(xx+xf+x, zz+zf+z);
|
||||
v = getComplex().getTrueBiomeDerivativeStream().get(xf+x, zf+z);
|
||||
|
||||
for(i = 0; i < h.getHeight(); i++)
|
||||
{
|
||||
h.set(xx+xf, i, zz+zf, v);
|
||||
h.set(xf, i, zf, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -41,22 +41,20 @@ public class IrisDecorantActuator extends EngineAssignedActuator<BlockData>
|
||||
|
||||
if(shouldRayDecorate())
|
||||
{
|
||||
output.iterateSurfaces2D(getParallelism(), PREDICATE_SOLID, (hunkRelativeX, hunkRelativeZ, hunkOffsetX, hunkOffsetZ, top, bottom, lastBottom, h) -> decorateLayer(x, z, hunkRelativeX, hunkRelativeZ, hunkOffsetX, hunkOffsetZ,top,bottom,lastBottom,h));
|
||||
output.iterateSurfaces2D(0, PREDICATE_SOLID, (hunkRelativeX, hunkRelativeZ, hunkOffsetX, hunkOffsetZ, top, bottom, lastBottom, h) -> decorateLayer(x, z, hunkRelativeX, hunkRelativeZ, hunkOffsetX, hunkOffsetZ,top,bottom,lastBottom,h));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
output.compute2D(getParallelism(), (xx, yy, zz, h) -> {
|
||||
int he;
|
||||
for(int i = 0; i < h.getWidth(); i++)
|
||||
for(int i = 0; i < output.getWidth(); i++)
|
||||
{
|
||||
for(int j = 0; j < h.getDepth(); j++)
|
||||
for(int j = 0; j < output.getDepth(); j++)
|
||||
{
|
||||
he = getComplex().getHeightFluidStream().get(x + xx+i, z + zz+j).intValue();
|
||||
decorateLayer(x, z, i, j, xx, zz, he, 0, getEngine().getHeight(), h);
|
||||
he = getComplex().getHeightFluidStream().get(x + i, z + j).intValue();
|
||||
decorateLayer(x, z, i, j, 0, 0, he, 0, getEngine().getHeight(), output);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,6 +80,11 @@ public class IrisDecorantActuator extends EngineAssignedActuator<BlockData>
|
||||
return;
|
||||
}
|
||||
|
||||
if(b.isShore() && floor <= getDimension().getFluidHeight())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IrisDecorator deco = getComplex().getTerrainSurfaceDecoration().get(realX, realZ);
|
||||
|
||||
if(deco != null)
|
||||
|
@ -22,47 +22,48 @@ public class IrisTerrainActuator extends EngineAssignedActuator<BlockData>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActuate(int x, int z, Hunk<BlockData> output) {
|
||||
output.compute2D(getParallelism(), (xx, yy, zz, h) -> {
|
||||
int i,zf, depth, atDepth;
|
||||
double he;
|
||||
BlockData block;
|
||||
public void onActuate(int x, int z, Hunk<BlockData> h) {
|
||||
int i,zf, depth, realX, realZ,hf, he;
|
||||
IrisBiome biome;
|
||||
KList<BlockData> blocks;
|
||||
|
||||
for(int xf = 0; xf < h.getWidth(); xf++)
|
||||
{
|
||||
for(zf = 0; zf < h.getDepth(); zf++)
|
||||
{
|
||||
he = Math.min(h.getHeight(), getComplex().getHeightFluidStream().get(xx+xf+x, zz+zf+z));
|
||||
biome = getComplex().getTrueBiomeStream().get(xx+xf+x, zz+zf+z);
|
||||
KList<BlockData> blocks = biome.generateLayers(xx+xf+x, zz+zf+z, rng, (int)he, (int)he, getData());
|
||||
realX = xf + x;
|
||||
realZ = zf + z;
|
||||
he = (int) Math.round(Math.min(h.getHeight(), getComplex().getHeightStream().get(realX, realZ)));
|
||||
hf = (int) Math.round(Math.max(Math.min(h.getHeight(), getDimension().getFluidHeight()), he));
|
||||
biome = getComplex().getTrueBiomeStream().get(realX, realZ);
|
||||
blocks = null;
|
||||
|
||||
for(i = 0; i < he; i++)
|
||||
for(i = hf; i >= 0; i--)
|
||||
{
|
||||
depth = ((int)he) - i;
|
||||
|
||||
if(i > he && i <= he)
|
||||
if(i > he && i <= hf)
|
||||
{
|
||||
h.set(xx+xf, i, zz+zf, getComplex().getFluidStream().get(xx+xf+x, zz+zf+z));
|
||||
h.set(xf, i, zf, getComplex().getFluidStream().get(realX, +realZ));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(depth < -1)
|
||||
if(i <= he)
|
||||
{
|
||||
h.set(xx+xf, i, zz+zf, AIR);
|
||||
depth = he - i;
|
||||
if(blocks == null)
|
||||
{
|
||||
blocks = biome.generateLayers(realX, realZ, rng, (int)he, (int)he, getData());
|
||||
}
|
||||
|
||||
if(blocks.hasIndex(depth))
|
||||
{
|
||||
h.set(xf, i, zf, blocks.get(depth));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(blocks.hasIndex(blocks.last() - ((int)he - depth)))
|
||||
{
|
||||
h.set(xx+xf, i, zz+zf, blocks.get(blocks.last() - ((int)he - depth)));
|
||||
continue;
|
||||
}
|
||||
|
||||
h.set(xx+xf, i, zz+zf, getComplex().getRockStream().get(xx+xf+x, zz+zf+z));
|
||||
h.set(xf, i, zf, getComplex().getRockStream().get(realX, realZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -7,53 +7,7 @@ import com.volmit.iris.v2.scaffold.parallax.ParallaxAccess;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
|
||||
public interface EngineActuator<O>
|
||||
public interface EngineActuator<O> extends EngineComponent
|
||||
{
|
||||
public Engine getEngine();
|
||||
|
||||
public RollingSequence getMetrics();
|
||||
|
||||
public String getName();
|
||||
|
||||
public default IrisDataManager getData()
|
||||
{
|
||||
return getEngine().getData();
|
||||
}
|
||||
|
||||
public default ParallaxAccess getParallax()
|
||||
{
|
||||
return getEngine().getParallax();
|
||||
}
|
||||
|
||||
public default EngineTarget getTarget()
|
||||
{
|
||||
return getEngine().getTarget();
|
||||
}
|
||||
|
||||
public default IrisDimension getDimension()
|
||||
{
|
||||
return getEngine().getDimension();
|
||||
}
|
||||
|
||||
public default long getSeed()
|
||||
{
|
||||
return getTarget().getWorld().getSeed();
|
||||
}
|
||||
|
||||
public default EngineFramework getFramework()
|
||||
{
|
||||
return getEngine().getFramework();
|
||||
}
|
||||
|
||||
public default int getParallelism()
|
||||
{
|
||||
return getEngine().getParallelism();
|
||||
}
|
||||
|
||||
public default IrisComplex getComplex()
|
||||
{
|
||||
return getFramework().getComplex();
|
||||
}
|
||||
|
||||
public void actuate(int x, int z, Hunk<O> output);
|
||||
}
|
||||
|
@ -7,32 +7,17 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
public abstract class EngineAssignedActuator<T> implements EngineActuator<T>
|
||||
public abstract class EngineAssignedActuator<T> extends EngineAssignedComponent implements EngineActuator<T>
|
||||
{
|
||||
|
||||
@Getter
|
||||
private final Engine engine;
|
||||
|
||||
@Getter
|
||||
private final RollingSequence metrics;
|
||||
|
||||
@Getter
|
||||
private final String name;
|
||||
|
||||
public EngineAssignedActuator(Engine engine, String name)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.name = name;
|
||||
metrics = new RollingSequence(16);
|
||||
super(engine, name);
|
||||
}
|
||||
|
||||
public abstract void onActuate(int x, int z, Hunk<T> output);
|
||||
|
||||
@Override
|
||||
public void actuate(int x, int z, Hunk<T> output) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
onActuate(x, z, output);
|
||||
p.end();
|
||||
getMetrics().put(p.getMilliseconds());
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.volmit.iris.v2.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.util.RollingSequence;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EngineAssignedComponent implements EngineComponent {
|
||||
private final Engine engine;
|
||||
private final RollingSequence metrics;
|
||||
private final String name;
|
||||
|
||||
public EngineAssignedComponent(Engine engine, String name)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.metrics = new RollingSequence(16);
|
||||
this.name = name;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.volmit.iris.v2.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.util.PrecisionStopwatch;
|
||||
import com.volmit.iris.util.RollingSequence;
|
||||
import com.volmit.iris.v2.scaffold.hunk.Hunk;
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class EngineAssignedModifier<T> extends EngineAssignedComponent implements EngineModifier<T>
|
||||
{
|
||||
public EngineAssignedModifier(Engine engine, String name)
|
||||
{
|
||||
super(engine, name);
|
||||
}
|
||||
|
||||
public abstract void onModify(Hunk<T> output);
|
||||
|
||||
@Override
|
||||
public void modify(Hunk<T> output) {
|
||||
onModify(output);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.volmit.iris.v2.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.RollingSequence;
|
||||
import com.volmit.iris.v2.generator.IrisComplex;
|
||||
import com.volmit.iris.v2.scaffold.parallax.ParallaxAccess;
|
||||
|
||||
public interface EngineComponent {
|
||||
public Engine getEngine();
|
||||
|
||||
public RollingSequence getMetrics();
|
||||
|
||||
public String getName();
|
||||
|
||||
public default IrisDataManager getData()
|
||||
{
|
||||
return getEngine().getData();
|
||||
}
|
||||
|
||||
public default ParallaxAccess getParallax()
|
||||
{
|
||||
return getEngine().getParallax();
|
||||
}
|
||||
|
||||
public default EngineTarget getTarget()
|
||||
{
|
||||
return getEngine().getTarget();
|
||||
}
|
||||
|
||||
public default IrisDimension getDimension()
|
||||
{
|
||||
return getEngine().getDimension();
|
||||
}
|
||||
|
||||
public default long getSeed()
|
||||
{
|
||||
return getTarget().getWorld().getSeed();
|
||||
}
|
||||
|
||||
public default EngineFramework getFramework()
|
||||
{
|
||||
return getEngine().getFramework();
|
||||
}
|
||||
|
||||
public default int getParallelism()
|
||||
{
|
||||
return getEngine().getParallelism();
|
||||
}
|
||||
|
||||
public default IrisComplex getComplex()
|
||||
{
|
||||
return getFramework().getComplex();
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.Form;
|
||||
import com.volmit.iris.util.M;
|
||||
import com.volmit.iris.util.PrecisionStopwatch;
|
||||
import com.volmit.iris.v2.generator.IrisEngineCompound;
|
||||
import com.volmit.iris.v2.scaffold.hunk.Hunk;
|
||||
@ -41,6 +42,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements Hotloada
|
||||
|
||||
public void hotload()
|
||||
{
|
||||
Iris.globaldata.dump();
|
||||
initialized.lazySet(false);
|
||||
}
|
||||
|
||||
@ -116,9 +118,9 @@ public class EngineCompositeGenerator extends ChunkGenerator implements Hotloada
|
||||
ChunkData chunk = createChunkData(world);
|
||||
Hunk<BlockData> blocks = Hunk.view(chunk);
|
||||
Hunk<Biome> biomes = Hunk.view(biome);
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
long m = M.ms();
|
||||
compound.generate(x * 16, z * 16, blocks, biomes);
|
||||
System.out.println("Generated " + x + "," + z + " in " + Form.duration(p.getMilliseconds(), 0) + " (Terrain: " + Form.duration(compound.getEngine(0).getFramework().getTerrainActuator().getMetrics().getAverage(), 2) + ", Biome: " + Form.duration(compound.getEngine(0).getFramework().getBiomeActuator().getMetrics().getAverage(), 2) + ", Decorant: " + Form.duration(compound.getEngine(0).getFramework().getDecorantActuator().getMetrics().getAverage(), 2) + ")");
|
||||
System.out.println("Generated " + x + "," + z + " in " + Form.duration(M.ms() - m, 0));
|
||||
return chunk;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.volmit.iris.v2.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.RollingSequence;
|
||||
import com.volmit.iris.v2.generator.IrisComplex;
|
||||
import com.volmit.iris.v2.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.v2.scaffold.parallax.ParallaxAccess;
|
||||
|
||||
public interface EngineModifier<T> extends EngineComponent {
|
||||
public void modify(Hunk<T> t);
|
||||
}
|
@ -27,6 +27,20 @@ public class BurstExecutor
|
||||
}
|
||||
}
|
||||
|
||||
public BurstExecutor queue(Runnable[] r)
|
||||
{
|
||||
synchronized(futures)
|
||||
{
|
||||
for(Runnable i : r)
|
||||
{
|
||||
CompletableFuture<Void> c = CompletableFuture.runAsync(i, executor);
|
||||
futures.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public void complete()
|
||||
{
|
||||
synchronized(futures)
|
||||
|
@ -13,6 +13,11 @@ public class MultiBurst
|
||||
service = Executors.newWorkStealingPool(tc);
|
||||
}
|
||||
|
||||
public void burst(Runnable... r)
|
||||
{
|
||||
burst(r.length).queue(r).complete();
|
||||
}
|
||||
|
||||
public BurstExecutor burst(int estimate)
|
||||
{
|
||||
return new BurstExecutor(service, estimate);
|
||||
|
Loading…
x
Reference in New Issue
Block a user