Island terrain mode (experimental)

This commit is contained in:
Daniel Mills
2021-07-17 00:29:33 -04:00
parent bcdd470567
commit da1895125a
9 changed files with 256 additions and 18 deletions

View File

@@ -290,6 +290,11 @@ public class IrisDimension extends IrisRegistrant {
@Desc("Change the size of regions")
private double regionZoom = 1;
@Desc("The terrain mode. NORMAL is normal... ISLANDS creates floating islands at varied heights")
private IrisTerrainMode terrainMode = IrisTerrainMode.NORMAL;
@Desc("The configuration for island mode dimensions")
private IrisTerrainIsland islandMode = new IrisTerrainIsland();
@Desc("Disable this to stop placing schematics in biomes")
private boolean placeObjects = true;

View File

@@ -38,29 +38,23 @@ import lombok.experimental.Accessors;
public class IrisGeneratorStyle {
@Required
@Desc("The chance is 1 in CHANCE per interval")
private NoiseStyle style = NoiseStyle.IRIS;
@MinNumber(0.00001)
@Desc("The zoom of this style")
private double zoom = 1;
@MinNumber(0.00001)
@Desc("The Output multiplier. Only used if parent is fracture.")
private double multiplier = 1;
@Desc("If set to true, each dimension will be fractured with a different order of input coordinates. This is usually 2 or 3 times slower than normal.")
private boolean maxFractureAccuracy = false;
@Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.")
private IrisGeneratorStyle fracture = null;
@MinNumber(0.01562)
@MaxNumber(64)
@Desc("The exponent")

View File

@@ -0,0 +1,63 @@
/*
* 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.engine.object;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.stream.ProceduralStream;
import com.volmit.iris.engine.stream.interpolation.Interpolated;
import com.volmit.iris.util.math.M;
import com.volmit.iris.util.math.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents a range styled with a custom generator")
@Data
public class IrisStyledRange {
@Desc("The minimum value")
private double min = 16;
@Desc("The maximum value")
private double max = 32;
@Desc("The style to pick the range")
private IrisGeneratorStyle style = new IrisGeneratorStyle(NoiseStyle.STATIC);
public double get(RNG rng, double x, double z) {
if (min == max) {
return min;
}
if(style.isFlat())
{
return M.lerp(min, max, 0.5);
}
return style.create(rng).fitDouble(min, max, x, z);
}
public ProceduralStream<Double> stream(RNG rng) {
return ProceduralStream.of((x, z) -> get(rng, x, z), Interpolated.DOUBLE);
}
}

View File

@@ -0,0 +1,45 @@
/*
* 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.engine.object;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MaxNumber;
import com.volmit.iris.engine.object.annotations.MinNumber;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Desc("Translate objects")
@Data
public class IrisTerrainIsland {
@Desc("The height range")
private IrisStyledRange height = new IrisStyledRange().setMin(60).setMax(160);
@Desc("How deep the island can get")
private IrisStyledRange islandDepth = new IrisStyledRange().setMin(60).setMax(160);
@MinNumber(1)
@MaxNumber(10000)
@Desc("How often are regions islands instead of nothing?")
private double islandChance = 0.5;
}

View File

@@ -0,0 +1,24 @@
/*
* 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.engine.object;
public enum IrisTerrainMode {
NORMAL,
ISLANDS
}