mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-28 11:39:07 +00:00
Cleanup
This commit is contained in:
@@ -22,13 +22,7 @@ import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.InferredType;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDecorationPart;
|
||||
import com.volmit.iris.engine.object.IrisDecorator;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.IrisGenerator;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.data.DataProvider;
|
||||
|
||||
@@ -34,11 +34,7 @@ import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.modifier.IrisCarveModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisDepositModifier;
|
||||
import com.volmit.iris.engine.modifier.IrisPostModifier;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisBiomePaletteLayer;
|
||||
import com.volmit.iris.engine.object.IrisDecorator;
|
||||
import com.volmit.iris.engine.object.IrisEngineData;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
|
||||
import com.volmit.iris.util.atomics.AtomicRollingSequence;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@@ -136,8 +132,7 @@ public class IrisEngine implements Engine {
|
||||
}
|
||||
|
||||
private void tickRandomPlayer() {
|
||||
if(perSecondBudLatch.flip())
|
||||
{
|
||||
if (perSecondBudLatch.flip()) {
|
||||
buds.set(bud.get());
|
||||
bud.set(0);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.volmit.iris.engine.framework.EnginePlayer;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,14 +27,7 @@ import com.volmit.iris.engine.mantle.components.MantleCarvingComponent;
|
||||
import com.volmit.iris.engine.mantle.components.MantleFeatureComponent;
|
||||
import com.volmit.iris.engine.mantle.components.MantleJigsawComponent;
|
||||
import com.volmit.iris.engine.mantle.components.MantleObjectComponent;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDepositGenerator;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.IrisObjectScale;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
|
||||
@@ -22,15 +22,7 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineAssignedWorldManager;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisBlockDrops;
|
||||
import com.volmit.iris.engine.object.IRare;
|
||||
import com.volmit.iris.engine.object.IrisEngineChunkData;
|
||||
import com.volmit.iris.engine.object.IrisEngineData;
|
||||
import com.volmit.iris.engine.object.IrisEngineSpawnerCooldown;
|
||||
import com.volmit.iris.engine.object.IrisEntitySpawn;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.IrisSpawner;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.format.Form;
|
||||
@@ -105,8 +97,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
interrupt();
|
||||
}
|
||||
|
||||
if(!getEngine().getWorld().hasRealWorld() && clw.flip())
|
||||
{
|
||||
if (!getEngine().getWorld().hasRealWorld() && clw.flip()) {
|
||||
getEngine().getWorld().tryGetRealWorld();
|
||||
}
|
||||
|
||||
@@ -227,8 +218,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
|
||||
Chunk c = cc[RNG.r.nextInt(cc.length)];
|
||||
|
||||
if(!c.isLoaded() || !Chunks.isSafe(c.getWorld(), c.getX(), c.getZ()))
|
||||
{
|
||||
if (!c.isLoaded() || !Chunks.isSafe(c.getWorld(), c.getX(), c.getZ())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,18 +26,7 @@ import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.object.IrisColor;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisEngineData;
|
||||
import com.volmit.iris.engine.object.IrisLootMode;
|
||||
import com.volmit.iris.engine.object.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
|
||||
@@ -33,13 +33,9 @@ public abstract class EngineAssignedModifier<T> extends EngineAssignedComponent
|
||||
@BlockCoordinates
|
||||
@Override
|
||||
public void modify(int x, int z, Hunk<T> output, boolean multicore) {
|
||||
try
|
||||
{
|
||||
try {
|
||||
onModify(x, z, output, multicore);
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Modifier Failure: " + getName());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package com.volmit.iris.engine.framework;
|
||||
|
||||
import com.volmit.iris.engine.object.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.InventorySlotType;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
@@ -21,16 +21,7 @@ package com.volmit.iris.engine.jigsaw;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.IObjectPlacer;
|
||||
import com.volmit.iris.engine.object.IrisJigsawPiece;
|
||||
import com.volmit.iris.engine.object.IrisJigsawPieceConnector;
|
||||
import com.volmit.iris.engine.object.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.engine.object.IrisObjectRotation;
|
||||
import com.volmit.iris.engine.object.IrisObjectTranslate;
|
||||
import com.volmit.iris.engine.object.TileData;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.AxisAlignedBB;
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.volmit.iris.util.mantle.MantleFlag;
|
||||
import com.volmit.iris.util.matter.Matter;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
import com.volmit.iris.util.matter.MatterMarker;
|
||||
import com.volmit.iris.util.matter.slices.MarkerMatter;
|
||||
import com.volmit.iris.util.matter.slices.UpdateMatter;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
@@ -65,12 +64,10 @@ public interface EngineMantle extends IObjectPlacer {
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
default KList<IrisPosition> findMarkers(int x, int z, MatterMarker marker)
|
||||
{
|
||||
default KList<IrisPosition> findMarkers(int x, int z, MatterMarker marker) {
|
||||
KList<IrisPosition> p = new KList<>();
|
||||
getMantle().iterateChunk(x, z, MatterMarker.class, (xx, yy, zz, mm) -> {
|
||||
if(marker.equals(mm))
|
||||
{
|
||||
if (marker.equals(mm)) {
|
||||
p.add(new IrisPosition(xx + (x << 4), yy, zz + (z << 4)));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,9 +22,9 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.IObjectPlacer;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.TileData;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
@@ -475,7 +475,7 @@ public class MantleWriter implements IObjectPlacer {
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void setConsumer(Set<IrisPosition> positions, Function3<Integer,Integer,Integer,T> data) {
|
||||
public <T> void setConsumer(Set<IrisPosition> positions, Function3<Integer, Integer, Integer, T> data) {
|
||||
for (IrisPosition i : positions) {
|
||||
set(i, data.apply(i.getX(), i.getY(), i.getZ()));
|
||||
}
|
||||
|
||||
@@ -22,13 +22,7 @@ import com.volmit.iris.engine.jigsaw.PlannedStructure;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.mantle.IrisMantleComponent;
|
||||
import com.volmit.iris.engine.mantle.MantleWriter;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructure;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.NoiseStyle;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.mantle.MantleFlag;
|
||||
|
||||
@@ -23,13 +23,7 @@ import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.mantle.IrisMantleComponent;
|
||||
import com.volmit.iris.engine.mantle.MantleWriter;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisFeature;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePositional;
|
||||
import com.volmit.iris.engine.object.IrisFeaturePotential;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.mantle.MantleFlag;
|
||||
|
||||
@@ -23,11 +23,7 @@ import com.volmit.iris.engine.actuator.IrisDecorantActuator;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineAssignedModifier;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.InferredType;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisDecorationPart;
|
||||
import com.volmit.iris.engine.object.IrisDecorator;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.data.B;
|
||||
@@ -65,8 +61,7 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
|
||||
KMap<Long, KList<Integer>> positions = new KMap<>();
|
||||
KMap<IrisPosition, MatterCavern> walls = new KMap<>();
|
||||
Consumer4<Integer, Integer, Integer, MatterCavern> iterator = (xx, yy, zz, c) -> {
|
||||
if(c == null)
|
||||
{
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -105,14 +100,10 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
|
||||
return;
|
||||
}
|
||||
|
||||
if(c.isWater())
|
||||
{
|
||||
output.set(rx, yy, rz, WATER);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
output.set(rx, yy, rz, AIR);
|
||||
if (c.isWater()) {
|
||||
output.set(rx, yy, rz, WATER);
|
||||
} else {
|
||||
output.set(rx, yy, rz, AIR);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -169,20 +160,18 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
|
||||
getEngine().getMetrics().getDeposit().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
private void processZone(Hunk<BlockData> output, MantleChunk mc, Mantle mantle, CaveZone zone, int rx, int rz, int xx, int zz) {
|
||||
private void processZone(Hunk<BlockData> output, MantleChunk mc, Mantle mantle, CaveZone zone, int rx, int rz, int xx, int zz) {
|
||||
boolean decFloor = B.isSolid(output.get(rx, zone.floor - 1, rz));
|
||||
boolean decCeiling = B.isSolid(output.get(rx, zone.ceiling + 1, rz));
|
||||
int center = (zone.floor + zone.ceiling) / 2;
|
||||
int thickness = zone.airThickness();
|
||||
String customBiome = "";
|
||||
|
||||
if(M.r(1D/16D))
|
||||
{
|
||||
if (M.r(1D / 16D)) {
|
||||
mantle.set(xx, zone.ceiling, zz, MarkerMatter.CAVE_CEILING);
|
||||
}
|
||||
|
||||
if(M.r(1D/16D))
|
||||
{
|
||||
if (M.r(1D / 16D)) {
|
||||
mantle.set(xx, zone.floor, zz, MarkerMatter.CAVE_FLOOR);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -26,8 +26,8 @@ import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.framework.EngineTarget;
|
||||
import com.volmit.iris.engine.framework.WrongEngineBroException;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.StudioMode;
|
||||
import com.volmit.iris.engine.platform.studio.StudioGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
|
||||
Reference in New Issue
Block a user