mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Cleanup
This commit is contained in:
parent
8f7db7e52f
commit
fc678684f5
@ -216,8 +216,7 @@ public class IrisProject {
|
||||
try {
|
||||
KList<Report> reports = scanForErrors();
|
||||
|
||||
if(reports.isNotEmpty())
|
||||
{
|
||||
if (reports.isNotEmpty()) {
|
||||
sender.sendMessage("There are " + reports.size() + " problems detected with this project. See console!");
|
||||
Iris.error("===========================================================");
|
||||
for (Report i : reports) {
|
||||
|
@ -122,7 +122,7 @@ public class TreeManager implements Listener {
|
||||
BlockState state = b.getState();
|
||||
state.setBlockData(d);
|
||||
blockStateList.add(b.getState());
|
||||
dataCache.put(new Location(event.getWorld(), x,y,z), d);
|
||||
dataCache.put(new Location(event.getWorld(), x, y, z), d);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -188,8 +188,7 @@ public class TreeManager implements Listener {
|
||||
for (BlockState block : iGrow.getBlocks()) {
|
||||
Location l = block.getLocation();
|
||||
|
||||
if(dataCache.containsKey(l))
|
||||
{
|
||||
if (dataCache.containsKey(l)) {
|
||||
l.getBlock().setBlockData(dataCache.get(l), false);
|
||||
}
|
||||
}
|
||||
@ -274,7 +273,7 @@ public class TreeManager implements Listener {
|
||||
}
|
||||
|
||||
Iris.debug("Blocks: " + blockPositions.size());
|
||||
Iris.debug("Min: " + a.toString() + " Max: " + b.toString());
|
||||
Iris.debug("Min: " + a + " Max: " + b);
|
||||
|
||||
// Create a cuboid with the size calculated before
|
||||
Cuboid cuboid = new Cuboid(a.toBlock(world).getLocation(), b.toBlock(world).getLocation());
|
||||
|
@ -75,7 +75,7 @@ public class SyndicatePregenMethod implements PregeneratorMethod {
|
||||
.seed(seed)
|
||||
.build())
|
||||
.output((o) -> {
|
||||
File to = new File(Iris.getTemp(), "send-" + pack.toString() + ".zip");
|
||||
File to = new File(Iris.getTemp(), "send-" + pack + ".zip");
|
||||
ZipUtil.pack(dimension.getLoader().getDataFolder(), to);
|
||||
|
||||
try {
|
||||
|
@ -169,8 +169,7 @@ public class IrisEngine extends BlockPopulator implements Engine {
|
||||
Hunk<BlockData> blocks = vblocks.listen((xx, y, zz, t) -> catchBlockUpdates(x + xx, y + getMinHeight(), z + zz, t));
|
||||
PrecisionStopwatch px = PrecisionStopwatch.start();
|
||||
|
||||
if(multicore)
|
||||
{
|
||||
if (multicore) {
|
||||
BurstExecutor b = burst().burst(16);
|
||||
for (int i = 0; i < vblocks.getWidth(); i++) {
|
||||
int finalI = i;
|
||||
@ -205,15 +204,12 @@ public class IrisEngine extends BlockPopulator implements Engine {
|
||||
}
|
||||
getMetrics().getTotal().put(p.getMilliseconds());
|
||||
|
||||
if(IrisSettings.get().getGeneral().isDebug())
|
||||
{
|
||||
if (IrisSettings.get().getGeneral().isDebug()) {
|
||||
KList<String> v = new KList<>();
|
||||
KMap<String, Double> g = getMetrics().pull();
|
||||
|
||||
for(String i : g.sortKNumber())
|
||||
{
|
||||
if(g.get(i) != null)
|
||||
{
|
||||
for (String i : g.sortKNumber()) {
|
||||
if (g.get(i) != null) {
|
||||
v.add(C.RESET + "" + C.LIGHT_PURPLE + i + ": " + C.UNDERLINE + C.BLUE + Form.duration(g.get(i), 0) + C.RESET + C.GRAY + "");
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import com.volmit.iris.engine.framework.EngineParallaxManager;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.scheduling.IrisLock;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.util.Consumer;
|
||||
|
||||
@ -62,13 +61,12 @@ public class IrisEngineParallax implements EngineParallaxManager {
|
||||
@Override
|
||||
@BlockCoordinates
|
||||
public KList<IrisFeaturePositional> forEachFeature(double x, double z) {
|
||||
int cx = ((int)x) >> 4;
|
||||
int cz = ((int)x) >> 4;
|
||||
int cx = ((int) x) >> 4;
|
||||
int cz = ((int) x) >> 4;
|
||||
long key = Cache.key(cx, cz);
|
||||
|
||||
return featureCache.compute(key, (k, v) -> {
|
||||
if(v != null)
|
||||
{
|
||||
if (v != null) {
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
public void onActuate(int x, int z, Hunk<BlockData> h, boolean multicore) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
|
||||
if(multicore)
|
||||
{
|
||||
if (multicore) {
|
||||
BurstExecutor e = getEngine().burst().burst(h.getWidth());
|
||||
for (int xf = 0; xf < h.getWidth(); xf++) {
|
||||
int finalXf = xf;
|
||||
@ -63,10 +62,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
}
|
||||
|
||||
e.complete();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
for (int xf = 0; xf < h.getWidth(); xf++) {
|
||||
terrainSliver(x, z, xf, h);
|
||||
}
|
||||
@ -77,6 +73,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
|
||||
/**
|
||||
* This is calling 1/16th of a chunk x/z slice. It is a plane from sky to bedrock 1 thick in the x direction.
|
||||
*
|
||||
* @param x the chunk x in blocks
|
||||
* @param z the chunk z in blocks
|
||||
* @param xf the current x slice
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
@ -42,7 +41,6 @@ import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
import com.volmit.iris.util.function.Consumer4;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.scheduling.IrisLock;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import org.bukkit.Chunk;
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.engine.modifier;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.B;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineAssignedModifier;
|
||||
@ -56,8 +55,7 @@ public class IrisCaveModifier extends EngineAssignedModifier<BlockData> {
|
||||
}
|
||||
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
if(multicore)
|
||||
{
|
||||
if (multicore) {
|
||||
BurstExecutor e = getEngine().burst().burst(a.getWidth());
|
||||
for (int i = 0; i < a.getWidth(); i++) {
|
||||
int finalI = i;
|
||||
@ -65,10 +63,7 @@ public class IrisCaveModifier extends EngineAssignedModifier<BlockData> {
|
||||
}
|
||||
|
||||
e.complete();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
for (int i = 0; i < a.getWidth(); i++) {
|
||||
modifySliver(x, z, i, a);
|
||||
}
|
||||
@ -77,8 +72,7 @@ public class IrisCaveModifier extends EngineAssignedModifier<BlockData> {
|
||||
getEngine().getMetrics().getCave().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
public void modifySliver(int x, int z, int finalI, Hunk<BlockData> a)
|
||||
{
|
||||
public void modifySliver(int x, int z, int finalI, Hunk<BlockData> a) {
|
||||
for (int j = 0; j < a.getDepth(); j++) {
|
||||
KList<CaveResult> caves = genCaves(x + finalI, z + j, finalI, j, a);
|
||||
int he = (int) Math.round(getComplex().getHeightStream().get(x + finalI, z + j));
|
||||
|
@ -51,8 +51,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
int i;
|
||||
AtomicInteger j = new AtomicInteger();
|
||||
if(multicore)
|
||||
{
|
||||
if (multicore) {
|
||||
BurstExecutor e = getEngine().burst().burst(output.getWidth());
|
||||
for (i = 0; i < output.getWidth(); i++) {
|
||||
int finalI = i;
|
||||
@ -63,10 +62,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
||||
});
|
||||
}
|
||||
e.complete();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
for (i = 0; i < output.getWidth(); i++) {
|
||||
for (j.set(0); j.get() < output.getDepth(); j.getAndIncrement()) {
|
||||
post(i, j.get(), output, i + x, j.get() + z);
|
||||
|
Loading…
x
Reference in New Issue
Block a user