mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Carving slice
This commit is contained in:
parent
a09829ed4b
commit
2fa5c7eca4
@ -35,6 +35,8 @@ import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.mantle.Mantle;
|
||||
import com.volmit.iris.util.mantle.MantleChunk;
|
||||
import com.volmit.iris.util.mantle.MantleFlag;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import com.volmit.iris.util.matter.slices.UpdateMatter;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import org.bukkit.Chunk;
|
||||
@ -226,7 +228,12 @@ public interface EngineMantle extends IObjectPlacer {
|
||||
|
||||
@BlockCoordinates
|
||||
default void updateBlock(int x, int y, int z) {
|
||||
getMantle().set(x, y, z, true);
|
||||
getMantle().set(x, y, z, UpdateMatter.ON);
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
default void cavernBlock(int x, int y, int z) {
|
||||
getMantle().set(x, y, z, CavernMatter.ON);
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
|
@ -33,6 +33,7 @@ import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.data.B;
|
||||
import com.volmit.iris.util.json.JSONObject;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -56,9 +57,6 @@ public class IrisCave extends IrisRegistrant {
|
||||
@Desc("Define potential forking features")
|
||||
private IrisCarving fork = new IrisCarving();
|
||||
|
||||
@Desc("Change the air block to fill worms with as caves")
|
||||
private IrisBlockData fill = new IrisBlockData("cave_air");
|
||||
|
||||
@Desc("Limit the worm from ever getting higher or lower than this range")
|
||||
private IrisRange verticalRange = new IrisRange(3, 255);
|
||||
|
||||
@ -77,7 +75,7 @@ public class IrisCave extends IrisRegistrant {
|
||||
writer.setLine(getWorm().generate(rng, engine.getData(), writer, verticalRange, x, y, z,
|
||||
(at) -> fork.doCarving(writer, rng, engine, at.getX(), at.getY(), at.getZ())),
|
||||
getWorm().getGirth().get(rng, x, z, engine.getData()), true,
|
||||
fill.getBlockData(engine.getData()));
|
||||
CavernMatter.ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,6 +29,7 @@ import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import lombok.Data;
|
||||
|
||||
@Desc("Represents an procedural eliptical shape")
|
||||
@ -40,9 +41,6 @@ public class IrisElipsoid implements IRare
|
||||
@MinNumber(1)
|
||||
private int rarity = 1;
|
||||
|
||||
@Desc("Change the air block to fill elipsoids with as caves")
|
||||
private IrisBlockData fill = new IrisBlockData("cave_air");
|
||||
|
||||
@Desc("The styled random radius for x")
|
||||
private IrisStyledRange xRadius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
|
||||
|
||||
@ -57,7 +55,7 @@ public class IrisElipsoid implements IRare
|
||||
writer.setElipsoid(x, y, z,
|
||||
xRadius.get(rng, z, y, engine.getData()),
|
||||
yRadius.get(rng, x, z, engine.getData()),
|
||||
zRadius.get(rng, y, x, engine.getData()), true, fill.getBlockData(engine.getData()));
|
||||
zRadius.get(rng, y, x, engine.getData()), true, CavernMatter.ON);
|
||||
}
|
||||
|
||||
public double maxSize() {
|
||||
|
@ -29,6 +29,7 @@ import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import lombok.Data;
|
||||
|
||||
@Desc("Represents an procedural eliptical shape")
|
||||
@ -40,15 +41,12 @@ public class IrisPyramid implements IRare
|
||||
@MinNumber(1)
|
||||
private int rarity = 1;
|
||||
|
||||
@Desc("Change the air block to fill elipsoids with as caves")
|
||||
private IrisBlockData fill = new IrisBlockData("cave_air");
|
||||
|
||||
@Desc("The styled random radius for x")
|
||||
private IrisStyledRange baseWidth = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
|
||||
|
||||
public void generate(RNG rng, Engine engine, MantleWriter writer, int x, int y, int z)
|
||||
{
|
||||
writer.setPyramid(x, y, z, fill.getBlockData(engine.getData()),
|
||||
writer.setPyramid(x, y, z, CavernMatter.ON,
|
||||
(int)baseWidth.get(rng, z, y, engine.getData()), true);
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import lombok.Data;
|
||||
|
||||
@Desc("Represents an procedural eliptical shape")
|
||||
@ -40,15 +41,12 @@ public class IrisSphere implements IRare
|
||||
@MinNumber(1)
|
||||
private int rarity = 1;
|
||||
|
||||
@Desc("Change the air block to fill elipsoids with as caves")
|
||||
private IrisBlockData fill = new IrisBlockData("cave_air");
|
||||
|
||||
@Desc("The styled random radius for x")
|
||||
private IrisStyledRange radius = new IrisStyledRange(1, 5, new IrisGeneratorStyle(NoiseStyle.STATIC));
|
||||
|
||||
public void generate(RNG rng, Engine engine, MantleWriter writer, int x, int y, int z)
|
||||
{
|
||||
writer.setSphere(x, y, z, radius.get(rng, z, y, engine.getData()),true, fill.getBlockData(engine.getData()));
|
||||
writer.setSphere(x, y, z, radius.get(rng, z, y, engine.getData()),true, CavernMatter.ON);
|
||||
}
|
||||
|
||||
public double maxSize() {
|
||||
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.volmit.iris.util.matter.slices;
|
||||
|
||||
import com.volmit.iris.util.matter.Sliced;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@Sliced
|
||||
public class CavernMatter extends RawMatter<CavernMatter.MatterCavern> {
|
||||
public static final MatterCavern ON = new MatterCavern(true);
|
||||
public static final MatterCavern OFF = new MatterCavern(false);
|
||||
|
||||
public CavernMatter() {
|
||||
this(1, 1, 1);
|
||||
}
|
||||
|
||||
public CavernMatter(int width, int height, int depth) {
|
||||
super(width, height, depth, MatterCavern.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNode(MatterCavern b, DataOutputStream dos) throws IOException {
|
||||
dos.writeBoolean(b.cavern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatterCavern readNode(DataInputStream din) throws IOException {
|
||||
return din.readBoolean() ? ON : OFF;
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class MatterCavern {
|
||||
private final boolean cavern;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user