9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-28 19:49:06 +00:00
This commit is contained in:
cyberpwn
2021-09-04 14:59:56 -04:00
parent 90f0a5eac6
commit 8e16b8e4a8
18 changed files with 55 additions and 128 deletions

View File

@@ -40,7 +40,6 @@ import org.bukkit.util.Vector;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
@Data
public class MantleWriter implements IObjectPlacer {
@@ -67,8 +66,7 @@ public class MantleWriter implements IObjectPlacer {
}
public <T> void setData(int x, int y, int z, T t) {
if(t == null)
{
if (t == null) {
return;
}
@@ -168,7 +166,7 @@ public class MantleWriter implements IObjectPlacer {
}
public <T> void setElipsoid(int cx, int cy, int cz, double rx, double ry, double rz, boolean fill, T data) {
setElipsoidFunction(cx, cy, cz, rx, ry, rz, fill, (a,b,c)->data);
setElipsoidFunction(cx, cy, cz, rx, ry, rz, fill, (a, b, c) -> data);
}
/**

View File

@@ -103,10 +103,9 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
if (c.isWater()) {
output.set(rx, yy, rz, WATER);
} else if(c.isLava()) {
} else if (c.isLava()) {
output.set(rx, yy, rz, LAVA);
}
else {
} else {
output.set(rx, yy, rz, AIR);
}
};
@@ -171,13 +170,11 @@ public class IrisCarveModifier extends EngineAssignedModifier<BlockData> {
int thickness = zone.airThickness();
String customBiome = "";
if(B.isDecorant(output.get(rx, zone.ceiling+1, rz)))
{
output.set(rx, zone.ceiling+1, rz, AIR);
if (B.isDecorant(output.get(rx, zone.ceiling + 1, rz))) {
output.set(rx, zone.ceiling + 1, rz, AIR);
}
if(B.isDecorant(output.get(rx, zone.ceiling, rz)))
{
if (B.isDecorant(output.get(rx, zone.ceiling, rz))) {
output.set(rx, zone.ceiling, rz, AIR);
}

View File

@@ -121,8 +121,7 @@ public class IrisDepositModifier extends EngineAssignedModifier<BlockData> {
continue;
}
if(!getEngine().getMantle().isCarved((cx << 4) + nx, ny, (cz << 4) + nz))
{
if (!getEngine().getMantle().isCarved((cx << 4) + nx, ny, (cz << 4) + nz)) {
data.set(nx, ny, nz, B.toDeepSlateOre(data.get(nx, ny, nz), clump.getBlocks().get(j)));
}
}

View File

@@ -18,7 +18,6 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.framework.Engine;
@@ -73,7 +72,8 @@ public class IrisCave extends IrisRegistrant {
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z, int waterHint) {
double girth = getWorm().getGirth().get(rng, x, z, engine.getData());
KList<IrisPosition> points = getWorm().generate(rng, engine.getData(), writer, verticalRange, x, y, z, (at) -> {});
KList<IrisPosition> points = getWorm().generate(rng, engine.getData(), writer, verticalRange, x, y, z, (at) -> {
});
int highestWater = Math.max(waterHint, -1);
if (highestWater == -1) {

View File

@@ -287,7 +287,7 @@ public class IrisDimension extends IrisRegistrant {
int jump = strongholdJumpDistance;
RNG rng = new RNG((seed * 223) + 12945);
for (int i = 0; i < maxStrongholds+1; i++) {
for (int i = 0; i < maxStrongholds + 1; i++) {
int m = i + 1;
pos.add(new Position2(
(int) ((rng.i(jump * i) + (jump * i)) * (rng.b() ? -1D : 1D)),

View File

@@ -73,8 +73,7 @@ public class IrisLake implements IRare {
double[] surfaces = new double[pos.size()];
int i = 0;
for(IrisPosition p : pos)
{
for (IrisPosition p : pos) {
surfaces[i] = engine.getComplex().getHeightStream().get(x, z);
ax += p.getX();
ay += surfaces[i];
@@ -92,11 +91,9 @@ public class IrisLake implements IRare {
double depth = dg.fitDouble(depthStyle.getMin(), depthStyle.getMax(), p.getX(), p.getZ()) + (surface - avg.getY());
double width = bw.fitDouble(widthStyle.getMin(), widthStyle.getMax(), p.getX(), p.getZ());
if(depth > 1)
{
writer.setElipsoidFunction(p.getX(), avg.getY(), p.getZ(), width, depth, width, true, (xx,yy,zz) -> {
if(yy > avg.getY())
{
if (depth > 1) {
writer.setElipsoidFunction(p.getX(), avg.getY(), p.getZ(), width, depth, width, true, (xx, yy, zz) -> {
if (yy > avg.getY()) {
return null;
}

View File

@@ -18,7 +18,6 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.loader.IrisRegistrant;
import com.volmit.iris.engine.framework.Engine;
@@ -150,13 +149,9 @@ public class IrisRavine extends IrisRegistrant {
break;
}
if(lavaLevel >= 0 && i <= lavaLevel + (surface - depthStyle.getMid()))
{
if (lavaLevel >= 0 && i <= lavaLevel + (surface - depthStyle.getMid())) {
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, l);
}
else
{
} else {
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, c);
}
}
@@ -174,13 +169,9 @@ public class IrisRavine extends IrisRegistrant {
break;
}
if(lavaLevel >= 0 && i <= lavaLevel + (surface - depthStyle.getMid()))
{
if (lavaLevel >= 0 && i <= lavaLevel + (surface - depthStyle.getMid())) {
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, l);
}
else
{
} else {
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, c);
}
}

View File

@@ -18,9 +18,7 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.mantle.MantleWriter;
import com.volmit.iris.engine.object.annotations.*;
@@ -30,8 +28,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.concurrent.atomic.AtomicBoolean;
@Snippet("river")
@Accessors(chain = true)
@NoArgsConstructor

View File

@@ -104,8 +104,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
}
} : null;
if(studio)
{
if (studio) {
hotloader.setPriority(Thread.MIN_PRIORITY);
hotloader.start();
hotloader.setName(getTarget().getWorld().name() + " Hotloader");
@@ -236,8 +235,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
@Override
public void close() {
withExclusiveControl(() -> {
if(isStudio())
{
if (isStudio()) {
hotloader.interrupt();
}
@@ -252,8 +250,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
@Override
public void hotload() {
if(!isStudio())
{
if (!isStudio()) {
return;
}