mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Tweak feature iteration
This commit is contained in:
parent
dff88403b5
commit
302f54971d
@ -138,7 +138,7 @@ public class IrisBoardManager implements BoardProvider, Listener {
|
|||||||
if (engine != null) {
|
if (engine != null) {
|
||||||
v.add("&7&m------------------");
|
v.add("&7&m------------------");
|
||||||
KList<IrisFeaturePositional> f = new KList<>();
|
KList<IrisFeaturePositional> f = new KList<>();
|
||||||
engine.getFramework().getEngineParallax().forEachFeature(x, z, f::add);
|
f.add(engine.getFramework().getEngineParallax().forEachFeature(x, z));
|
||||||
v.add(C.AQUA + "Engine" + C.GRAY + ": " + engine.getName() + " " + engine.getMinHeight() + "-" + engine.getMaxHeight());
|
v.add(C.AQUA + "Engine" + C.GRAY + ": " + engine.getName() + " " + engine.getMinHeight() + "-" + engine.getMaxHeight());
|
||||||
v.add(C.AQUA + "Region" + C.GRAY + ": " + engine.getRegion(x, z).getName());
|
v.add(C.AQUA + "Region" + C.GRAY + ": " + engine.getRegion(x, z).getName());
|
||||||
v.add(C.AQUA + "Biome" + C.GRAY + ": " + engine.getBiome(x, y, z).getName());
|
v.add(C.AQUA + "Biome" + C.GRAY + ": " + engine.getBiome(x, y, z).getName());
|
||||||
|
@ -205,8 +205,11 @@ public class IrisComplex implements DataProvider {
|
|||||||
objectChanceStream = ProceduralStream.ofDouble((x, z) -> {
|
objectChanceStream = ProceduralStream.ofDouble((x, z) -> {
|
||||||
if (engine.getDimension().hasFeatures(engine)) {
|
if (engine.getDimension().hasFeatures(engine)) {
|
||||||
AtomicDouble str = new AtomicDouble(1D);
|
AtomicDouble str = new AtomicDouble(1D);
|
||||||
engine.getFramework().getEngineParallax().forEachFeature(x, z, (i)
|
for(IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z))
|
||||||
-> str.set(Math.min(str.get(), i.getObjectChanceModifier(x, z, rng))));
|
{
|
||||||
|
str.set(Math.min(str.get(), i.getObjectChanceModifier(x, z, rng)));
|
||||||
|
}
|
||||||
|
|
||||||
return str.get();
|
return str.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,8 +412,12 @@ public class IrisComplex implements DataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AtomicDouble noise = new AtomicDouble(h + fluidHeight + overlayStream.get(x, z));
|
AtomicDouble noise = new AtomicDouble(h + fluidHeight + overlayStream.get(x, z));
|
||||||
engine.getFramework().getEngineParallax().forEachFeature(x, z, (i)
|
|
||||||
-> noise.set(i.filter(x, z, noise.get(), rng)));
|
for(IrisFeaturePositional i : engine.getFramework().getEngineParallax().forEachFeature(x, z))
|
||||||
|
{
|
||||||
|
noise.set(i.filter(x, z, noise.get(), rng));
|
||||||
|
}
|
||||||
|
|
||||||
return Math.min(engine.getHeight(), Math.max(noise.get(), 0));
|
return Math.min(engine.getHeight(), Math.max(noise.get(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,59 +198,45 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BlockCoordinates
|
|
||||||
default void forEachFeature(double x, double z, Consumer<IrisFeaturePositional> f) {
|
|
||||||
if (!getEngine().getDimension().hasFeatures(getEngine())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (IrisFeaturePositional ipf : forEachFeature(x, z)) {
|
|
||||||
f.accept(ipf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@BlockCoordinates
|
@BlockCoordinates
|
||||||
default KList<IrisFeaturePositional> forEachFeature(double x, double z) {
|
default KList<IrisFeaturePositional> forEachFeature(double x, double z) {
|
||||||
synchronized (getEngine())
|
KList<IrisFeaturePositional> pos = new KList<>();
|
||||||
{
|
|
||||||
KList<IrisFeaturePositional> pos = new KList<>();
|
|
||||||
|
|
||||||
if (!getEngine().getDimension().hasFeatures(getEngine())) {
|
|
||||||
return pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (IrisFeaturePositional i : getEngine().getDimension().getSpecificFeatures()) {
|
|
||||||
if (i.shouldFilter(x, z, getEngine().getFramework().getComplex().getRng())) {
|
|
||||||
pos.add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int s = (int) Math.ceil(getParallaxSize() / 2D);
|
|
||||||
|
|
||||||
int i, j;
|
|
||||||
int cx = (int)x >> 4;
|
|
||||||
int cz = (int)z >> 4;
|
|
||||||
|
|
||||||
for (i = -s; i <= s; i++) {
|
|
||||||
for (j = -s; j <= s; j++) {
|
|
||||||
ParallaxChunkMeta m = getParallaxAccess().getMetaR(i + cx, j + cz);
|
|
||||||
|
|
||||||
try {
|
|
||||||
for (IrisFeaturePositional k : m.getFeatures()) {
|
|
||||||
if (k.shouldFilter(x, z, getEngine().getFramework().getComplex().getRng())) {
|
|
||||||
pos.add(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Iris.error("FILTER ERROR" + " AT " + (cx + i) + " " + (j + cz));
|
|
||||||
e.printStackTrace();
|
|
||||||
Iris.reportError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!getEngine().getDimension().hasFeatures(getEngine())) {
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (IrisFeaturePositional i : getEngine().getDimension().getSpecificFeatures()) {
|
||||||
|
if (i.shouldFilter(x, z, getEngine().getFramework().getComplex().getRng())) {
|
||||||
|
pos.add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int s = (int) Math.ceil(getParallaxSize() / 2D);
|
||||||
|
|
||||||
|
int i, j;
|
||||||
|
int cx = (int)x >> 4;
|
||||||
|
int cz = (int)z >> 4;
|
||||||
|
|
||||||
|
for (i = -s; i <= s; i++) {
|
||||||
|
for (j = -s; j <= s; j++) {
|
||||||
|
ParallaxChunkMeta m = getParallaxAccess().getMetaR(i + cx, j + cz);
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (IrisFeaturePositional k : m.getFeatures()) {
|
||||||
|
if (k.shouldFilter(x, z, getEngine().getFramework().getComplex().getRng())) {
|
||||||
|
pos.add(k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Iris.error("FILTER ERROR" + " AT " + (cx + i) + " " + (j + cz));
|
||||||
|
e.printStackTrace();
|
||||||
|
Iris.reportError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user