mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Faster
This commit is contained in:
@@ -3,6 +3,8 @@ package com.volmit.iris.generator.actuator;
|
||||
import com.volmit.iris.scaffold.engine.Engine;
|
||||
import com.volmit.iris.scaffold.engine.EngineAssignedActuator;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.scaffold.parallel.BurstExecutor;
|
||||
import com.volmit.iris.scaffold.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.PrecisionStopwatch;
|
||||
import org.bukkit.block.Biome;
|
||||
|
||||
@@ -15,21 +17,28 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome>
|
||||
@Override
|
||||
public void onActuate(int x, int z, Hunk<Biome> h) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
int i,zf;
|
||||
Biome v;
|
||||
int zf,hh;
|
||||
BurstExecutor burst = MultiBurst.burst.burst(h.getWidth() * h.getDepth());
|
||||
|
||||
for(int xf = 0; xf < h.getWidth(); xf++)
|
||||
{
|
||||
for(zf = 0; zf < h.getDepth(); zf++)
|
||||
{
|
||||
v = getComplex().getTrueBiomeStream().get(modX(xf+x), modZ(zf+z)).getDerivative();
|
||||
int xxf = xf;
|
||||
int zzf = zf;
|
||||
|
||||
for(i = 0; i < h.getHeight(); i++)
|
||||
{
|
||||
h.set(xf, i, zf, v);
|
||||
}
|
||||
burst.queue(() -> {
|
||||
Biome v = getComplex().getTrueBiomeStream().get(modX(xxf+x), modZ(zzf+z)).getDerivative();
|
||||
for(int i = 0; i < h.getHeight(); i++)
|
||||
{
|
||||
h.set(xxf, i, zzf, v);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
burst.complete();
|
||||
|
||||
getEngine().getMetrics().getBiome().put(p.getMilliseconds());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.scaffold.engine.Engine;
|
||||
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.scaffold.parallel.BurstExecutor;
|
||||
import com.volmit.iris.scaffold.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.B;
|
||||
import com.volmit.iris.util.CaveResult;
|
||||
import com.volmit.iris.util.PrecisionStopwatch;
|
||||
@@ -27,13 +29,18 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
||||
@Override
|
||||
public void onModify(int x, int z, Hunk<BlockData> output) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
for(int i = 0; i < output.getWidth(); i++)
|
||||
BurstExecutor b = MultiBurst.burst.burst(output.getWidth() * output.getDepth());
|
||||
int i, j;
|
||||
for(i = 0; i < output.getWidth(); i++)
|
||||
{
|
||||
for(int j = 0; j < output.getDepth(); j++)
|
||||
int ii = i;
|
||||
for(j = 0; j < output.getDepth(); j++)
|
||||
{
|
||||
post(i, j, output, i+x, j+z);
|
||||
int jj = j;
|
||||
b.queue(() -> post(ii, jj, output, ii+x, jj+z));
|
||||
}
|
||||
}
|
||||
b.complete();
|
||||
getEngine().getMetrics().getPost().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user