mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Clean
This commit is contained in:
parent
959f96dd74
commit
2f8fe43ea3
@ -29,8 +29,6 @@ import com.volmit.iris.engine.object.*;
|
|||||||
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
||||||
import com.volmit.iris.engine.parallax.ParallaxChunkMeta;
|
import com.volmit.iris.engine.parallax.ParallaxChunkMeta;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.collection.KMap;
|
|
||||||
import com.volmit.iris.util.format.Form;
|
|
||||||
import com.volmit.iris.util.math.RNG;
|
import com.volmit.iris.util.math.RNG;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.bukkit.Axis;
|
import org.bukkit.Axis;
|
||||||
@ -53,8 +51,6 @@ public class PlannedStructure {
|
|||||||
private RNG rng;
|
private RNG rng;
|
||||||
private boolean verbose;
|
private boolean verbose;
|
||||||
private boolean terminating;
|
private boolean terminating;
|
||||||
private static int hit = 0;
|
|
||||||
private static int miss = 0;
|
|
||||||
|
|
||||||
public PlannedStructure(IrisJigsawStructure structure, IrisPosition position, RNG rng) {
|
public PlannedStructure(IrisJigsawStructure structure, IrisPosition position, RNG rng) {
|
||||||
terminating = false;
|
terminating = false;
|
||||||
@ -402,19 +398,11 @@ public class PlannedStructure {
|
|||||||
String key = piece.getObject() + "-" + rotation.hashCode();
|
String key = piece.getObject() + "-" + rotation.hashCode();
|
||||||
|
|
||||||
return objectRotationCache.compute(key, (k, v) -> {
|
return objectRotationCache.compute(key, (k, v) -> {
|
||||||
if(v == null)
|
if (v == null) {
|
||||||
{
|
|
||||||
miss++;
|
|
||||||
return rotation.rotateCopy(data.getObjectLoader().load(piece.getObject()));
|
return rotation.rotateCopy(data.getObjectLoader().load(piece.getObject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
hit++;
|
|
||||||
printCacheHit();
|
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printCacheHit() {
|
|
||||||
System.out.println("Cache Hit " + Form.pc((double) hit / (double) (hit + miss), 2) + " Cache Hit: " + hit + " hits " + miss + " misses.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
|||||||
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
|
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
|
||||||
return d instanceof Levelled;
|
return d instanceof Levelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPostBlock(int x, int y, int z, BlockData d, int currentPostX, int currentPostZ, Hunk<BlockData> currentData) {
|
public void setPostBlock(int x, int y, int z, BlockData d, int currentPostX, int currentPostZ, Hunk<BlockData> currentData) {
|
||||||
if (y < currentData.getHeight()) {
|
if (y < currentData.getHeight()) {
|
||||||
currentData.set(x & 15, y, z & 15, d);
|
currentData.set(x & 15, y, z & 15, d);
|
||||||
|
@ -349,8 +349,7 @@ public class CNG {
|
|||||||
private double getNoise(double... dim) {
|
private double getNoise(double... dim) {
|
||||||
double scale = noscale ? 1 : this.bakedScale * this.scale;
|
double scale = noscale ? 1 : this.bakedScale * this.scale;
|
||||||
|
|
||||||
if(fracture == null || noscale)
|
if (fracture == null || noscale) {
|
||||||
{
|
|
||||||
return generator.noise(
|
return generator.noise(
|
||||||
(dim.length > 0 ? dim[0] : 0D) * scale,
|
(dim.length > 0 ? dim[0] : 0D) * scale,
|
||||||
(dim.length > 1 ? dim[1] : 0D) * scale,
|
(dim.length > 1 ? dim[1] : 0D) * scale,
|
||||||
@ -372,18 +371,11 @@ public class CNG {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double invertNoise(double... dim) {
|
public double invertNoise(double... dim) {
|
||||||
if(dim.length == 1)
|
if (dim.length == 1) {
|
||||||
{
|
|
||||||
return noise(-dim[0]);
|
return noise(-dim[0]);
|
||||||
}
|
} else if (dim.length == 2) {
|
||||||
|
|
||||||
else if(dim.length == 2)
|
|
||||||
{
|
|
||||||
return noise(dim[1], dim[0]);
|
return noise(dim[1], dim[0]);
|
||||||
}
|
} else if (dim.length == 3) {
|
||||||
|
|
||||||
else if(dim.length == 3)
|
|
||||||
{
|
|
||||||
return noise(dim[1], dim[2], dim[0]);
|
return noise(dim[1], dim[2], dim[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user