mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Cleanup
This commit is contained in:
@@ -74,40 +74,34 @@ public class IrisCave extends IrisRegistrant {
|
||||
|
||||
double girth = getWorm().getGirth().get(rng, x, z, engine.getData());
|
||||
KList<IrisPosition> points = getWorm().generate(rng, engine.getData(), writer, verticalRange, x, y, z,
|
||||
(at) -> {});
|
||||
(at) -> {
|
||||
});
|
||||
int highestWater = Math.max(waterHint, -1);
|
||||
boolean water = false;
|
||||
|
||||
if(highestWater == -1)
|
||||
{
|
||||
for(IrisPosition i : points)
|
||||
{
|
||||
if (highestWater == -1) {
|
||||
for (IrisPosition i : points) {
|
||||
double yy = i.getY() + girth;
|
||||
int th = engine.getHeight(x, z, true);
|
||||
|
||||
if(yy > th && th < engine.getDimension().getFluidHeight())
|
||||
{
|
||||
highestWater = Math.max(highestWater, (int)yy);
|
||||
if (yy > th && th < engine.getDimension().getFluidHeight()) {
|
||||
highestWater = Math.max(highestWater, (int) yy);
|
||||
water = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
water = true;
|
||||
}
|
||||
|
||||
int h = Math.min(Math.max(highestWater, waterHint), engine.getDimension().getFluidHeight());
|
||||
int h = Math.min(Math.max(highestWater, waterHint), engine.getDimension().getFluidHeight());
|
||||
|
||||
for(IrisPosition i : points)
|
||||
{
|
||||
for (IrisPosition i : points) {
|
||||
fork.doCarving(writer, rng, engine, i.getX(), i.getY(), i.getZ(), h);
|
||||
}
|
||||
|
||||
writer.setLineConsumer(points,
|
||||
girth, true,
|
||||
girth, true,
|
||||
(xf, yf, zf) -> new MatterCavern(true, customBiome, yf <= h));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ public class IrisCavePlacer implements IRare {
|
||||
public IrisCave getRealCave(IrisData data) {
|
||||
return caveCache.aquire(() -> data.getCaveLoader().load(getCave()));
|
||||
}
|
||||
|
||||
public void generateCave(MantleWriter mantle, RNG rng, Engine engine, int x, int y, int z) {
|
||||
generateCave(mantle, rng, engine, x, y, z, -1);
|
||||
}
|
||||
@@ -101,8 +102,7 @@ public class IrisCavePlacer implements IRare {
|
||||
public int getSize(IrisData data) {
|
||||
IrisCave cave = getRealCave(data);
|
||||
|
||||
if(cave != null)
|
||||
{
|
||||
if (cave != null) {
|
||||
return cave.getMaxSize(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisRate;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -166,8 +166,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
}
|
||||
|
||||
public Entity spawn(Engine gen, Location at, RNG rng) {
|
||||
if(!Chunks.isSafe(at))
|
||||
{
|
||||
if (!Chunks.isSafe(at)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -180,8 +179,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
|
||||
Entity ee = doSpawn(at);
|
||||
|
||||
if(ee == null && !Chunks.isSafe(at))
|
||||
{
|
||||
if (ee == null && !Chunks.isSafe(at)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -345,8 +343,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
AtomicInteger t = new AtomicInteger(0);
|
||||
AtomicInteger v = new AtomicInteger(0);
|
||||
v.set(J.sr(() -> {
|
||||
if(t.get() > 100)
|
||||
{
|
||||
if (t.get() > 100) {
|
||||
J.csr(v.get());
|
||||
return;
|
||||
}
|
||||
@@ -389,8 +386,7 @@ public class IrisEntity extends IrisRegistrant {
|
||||
}
|
||||
|
||||
private Entity doSpawn(Location at) {
|
||||
if(!Chunks.isSafe(at))
|
||||
{
|
||||
if (!Chunks.isSafe(at)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,11 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.MatterMarker;
|
||||
import com.volmit.iris.util.matter.slices.MarkerMatter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -21,8 +21,6 @@ package com.volmit.iris.engine.object;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.IrisLootTable;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -21,8 +21,6 @@ package com.volmit.iris.engine.object;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.IrisBlockData;
|
||||
import com.volmit.iris.engine.object.IrisMaterialPalette;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.noise.CNG;
|
||||
|
||||
@@ -88,70 +88,61 @@ public class IrisRavine extends IrisRegistrant {
|
||||
public String getTypeName() {
|
||||
return "Ravine";
|
||||
}
|
||||
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z) {
|
||||
generate(writer, rng, engine, x, y, z, -1);
|
||||
}
|
||||
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z, int waterHint) {
|
||||
|
||||
KList<IrisPosition> pos = getWorm().generate(rng, engine.getData(), writer, null, x, y, z, (at) -> {});
|
||||
KList<IrisPosition> pos = getWorm().generate(rng, engine.getData(), writer, null, x, y, z, (at) -> {
|
||||
});
|
||||
CNG dg = depthStyle.getGenerator().createNoCache(rng, engine.getData());
|
||||
CNG bw = baseWidthStyle.getGenerator().createNoCache(rng, engine.getData());
|
||||
int highestWater = Math.max(waterHint, -1);
|
||||
boolean water = false;
|
||||
|
||||
if(highestWater == -1)
|
||||
{
|
||||
for(IrisPosition i : pos)
|
||||
{
|
||||
if (highestWater == -1) {
|
||||
for (IrisPosition i : pos) {
|
||||
int rsurface = y == -1 ? engine.getComplex().getHeightStream().get(x, z).intValue() : y;
|
||||
int depth = (int) Math.round(dg.fitDouble(depthStyle.getMin(), depthStyle.getMax(), i.getX(), i.getZ()));
|
||||
int surface = (int) Math.round(rsurface - depth * 0.45);
|
||||
int yy = surface + depth;
|
||||
int th = engine.getHeight(x, z, true);
|
||||
|
||||
if(yy > th && th < engine.getDimension().getFluidHeight())
|
||||
{
|
||||
if (yy > th && th < engine.getDimension().getFluidHeight()) {
|
||||
highestWater = Math.max(highestWater, yy);
|
||||
water = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
water = true;
|
||||
}
|
||||
|
||||
MatterCavern c = new MatterCavern(true, customBiome, water);
|
||||
|
||||
if(pos.size() < nodeThreshold)
|
||||
{
|
||||
if (pos.size() < nodeThreshold) {
|
||||
return;
|
||||
}
|
||||
|
||||
for(IrisPosition p : pos)
|
||||
{
|
||||
for (IrisPosition p : pos) {
|
||||
int rsurface = y == -1 ? engine.getComplex().getHeightStream().get(x, z).intValue() : y;
|
||||
int depth = (int) Math.round(dg.fitDouble(depthStyle.getMin(), depthStyle.getMax(), p.getX(), p.getZ()));
|
||||
int width = (int) Math.round(bw.fitDouble(baseWidthStyle.getMin(), baseWidthStyle.getMax(), p.getX(), p.getZ()));
|
||||
int surface = (int) Math.round(rsurface - depth * 0.45);
|
||||
|
||||
fork.doCarving(writer, rng, engine, p.getX(), rng.i(surface-depth, surface), p.getZ(), Math.max(highestWater, waterHint));
|
||||
fork.doCarving(writer, rng, engine, p.getX(), rng.i(surface - depth, surface), p.getZ(), Math.max(highestWater, waterHint));
|
||||
|
||||
for(int i = surface + depth; i >= surface; i--)
|
||||
{
|
||||
if(i % ribThickness == 0) {
|
||||
for (int i = surface + depth; i >= surface; i--) {
|
||||
if (i % ribThickness == 0) {
|
||||
double v = width + ((((surface + depth) - i) * (angle / 360D)));
|
||||
|
||||
if(v <= 0.25)
|
||||
{
|
||||
if (v <= 0.25) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(i <= ribThickness+2)
|
||||
{
|
||||
if (i <= ribThickness + 2) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -159,18 +150,15 @@ public class IrisRavine extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = surface - depth; i <= surface; i++)
|
||||
{
|
||||
if(i % ribThickness == 0) {
|
||||
for (int i = surface - depth; i <= surface; i++) {
|
||||
if (i % ribThickness == 0) {
|
||||
double v = width - ((((surface - depth) - i) * (angle / 360D)));
|
||||
|
||||
if(v <= 0.25)
|
||||
{
|
||||
if (v <= 0.25) {
|
||||
break;
|
||||
}
|
||||
|
||||
if(i <= ribThickness+2)
|
||||
{
|
||||
if (i <= ribThickness + 2) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.volmit.iris.engine.object.annotations;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
|
||||
Reference in New Issue
Block a user