mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Remove spot & ridge biomes
This commit is contained in:
parent
fcc3bbf9b6
commit
a51f5fefc4
@ -164,14 +164,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
|||||||
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
|
||||||
private KList<String> caveBiomes = new KList<>();
|
private KList<String> caveBiomes = new KList<>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisRegionRidge.class)
|
|
||||||
@Desc("Ridge biomes create a vein-like network like rivers through this region")
|
|
||||||
private KList<IrisRegionRidge> ridgeBiomes = new KList<>();
|
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisRegionSpot.class)
|
|
||||||
@Desc("Spot biomes splotch themselves across this region like lakes")
|
|
||||||
private KList<IrisRegionSpot> spotBiomes = new KList<>();
|
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisDepositGenerator.class)
|
@ArrayType(min = 1, type = IrisDepositGenerator.class)
|
||||||
@Desc("Define regional deposit generators that add onto the global deposit generators")
|
@Desc("Define regional deposit generators that add onto the global deposit generators")
|
||||||
private KList<IrisDepositGenerator> deposits = new KList<>();
|
private KList<IrisDepositGenerator> deposits = new KList<>();
|
||||||
@ -273,26 +265,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<String> getRidgeBiomeKeys() {
|
|
||||||
return cacheRidge.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<String> cacheRidge = new KList<>();
|
|
||||||
ridgeBiomes.forEach((i) -> cacheRidge.add(i.getBiome()));
|
|
||||||
|
|
||||||
return cacheRidge;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public KList<String> getSpotBiomeKeys() {
|
|
||||||
return cacheSpot.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<String> cacheSpot = new KList<>();
|
|
||||||
spotBiomes.forEach((i) -> cacheSpot.add(i.getBiome()));
|
|
||||||
return cacheSpot;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public CNG getShoreHeightGenerator() {
|
public CNG getShoreHeightGenerator() {
|
||||||
return shoreHeightGenerator.aquire(() ->
|
return shoreHeightGenerator.aquire(() ->
|
||||||
CNG.signature(new RNG((long) (getName().length() + getLandBiomeZoom() + getLandBiomes().size() + 3458612))));
|
CNG.signature(new RNG((long) (getName().length() + getLandBiomeZoom() + getLandBiomes().size() + 3458612))));
|
||||||
@ -308,8 +281,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
|||||||
names.addAll(caveBiomes);
|
names.addAll(caveBiomes);
|
||||||
names.addAll(seaBiomes);
|
names.addAll(seaBiomes);
|
||||||
names.addAll(shoreBiomes);
|
names.addAll(shoreBiomes);
|
||||||
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
|
||||||
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
@ -414,8 +385,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
|||||||
names.addAll(caveBiomes);
|
names.addAll(caveBiomes);
|
||||||
names.addAll(seaBiomes);
|
names.addAll(seaBiomes);
|
||||||
names.addAll(shoreBiomes);
|
names.addAll(shoreBiomes);
|
||||||
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
|
||||||
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
|
||||||
|
|
||||||
while (!names.isEmpty()) {
|
while (!names.isEmpty()) {
|
||||||
for (String i : new KList<>(names)) {
|
for (String i : new KList<>(names)) {
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.regional;
|
|
||||||
|
|
||||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
|
||||||
import com.volmit.iris.engine.object.annotations.*;
|
|
||||||
import com.volmit.iris.engine.object.biome.InferredType;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
|
||||||
import com.volmit.iris.util.math.RNG;
|
|
||||||
import com.volmit.iris.util.noise.CellGenerator;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Desc("A ridge config")
|
|
||||||
@Data
|
|
||||||
public class IrisRegionRidge {
|
|
||||||
@RegistryListResource(IrisBiome.class)
|
|
||||||
@Required
|
|
||||||
@Desc("The biome name")
|
|
||||||
private String biome = "";
|
|
||||||
|
|
||||||
@Required
|
|
||||||
@Desc("The type this biome should override (land sea or shore)")
|
|
||||||
private InferredType type = InferredType.LAND;
|
|
||||||
|
|
||||||
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
|
|
||||||
private InferredType as = InferredType.DEFER;
|
|
||||||
|
|
||||||
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
|
|
||||||
private double noiseMultiplier = 0;
|
|
||||||
|
|
||||||
@Required
|
|
||||||
@MinNumber(0)
|
|
||||||
@MaxNumber(1)
|
|
||||||
@Desc("The chance this biome will be placed in a given spot")
|
|
||||||
private double chance = 0.75;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The scale of the biome ridge. Higher values = wider veins & bigger connected cells")
|
|
||||||
private double scale = 5;
|
|
||||||
|
|
||||||
@Desc("The chance scale (cell chances)")
|
|
||||||
private double chanceScale = 4;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The shuffle, how 'natural' this looks. Compared to pure polygons")
|
|
||||||
private double shuffle = 16;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The chance shuffle (polygon cell chances)")
|
|
||||||
private double chanceShuffle = 128;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The thickness of the vein")
|
|
||||||
private double thickness = 0.125;
|
|
||||||
|
|
||||||
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
|
|
||||||
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
|
|
||||||
private final transient AtomicCache<CellGenerator> spot = new AtomicCache<>();
|
|
||||||
private final transient AtomicCache<CellGenerator> ridge = new AtomicCache<>();
|
|
||||||
|
|
||||||
public CellGenerator getSpotGenerator(RNG rng) {
|
|
||||||
return spot.aquire(() ->
|
|
||||||
{
|
|
||||||
CellGenerator spot = new CellGenerator(rng.nextParallelRNG((int) (198523 * getChance())));
|
|
||||||
spot.setCellScale(chanceScale);
|
|
||||||
spot.setShuffle(shuffle);
|
|
||||||
return spot;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public CellGenerator getRidgeGenerator(RNG rng) {
|
|
||||||
return spot.aquire(() ->
|
|
||||||
{
|
|
||||||
CellGenerator ridge = new CellGenerator(rng.nextParallelRNG((int) (465583 * getChance())));
|
|
||||||
ridge.setCellScale(scale);
|
|
||||||
ridge.setShuffle(shuffle);
|
|
||||||
return ridge;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getRidgeHeight(RNG rng, double x, double z) {
|
|
||||||
if (getNoiseMultiplier() == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getSpotGenerator(rng).getDistance(x, z) * getRidgeGenerator(rng).getDistance(x, z) * getNoiseMultiplier();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRidge(RNG rng, double x, double z) {
|
|
||||||
if (chance < 1) {
|
|
||||||
if (getSpotGenerator(rng).getIndex(x, z, 1000) > chance * 1000) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return getRidgeGenerator(rng).getDistance(x, z) <= thickness;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.regional;
|
|
||||||
|
|
||||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
|
||||||
import com.volmit.iris.engine.object.annotations.Desc;
|
|
||||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
|
||||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
|
||||||
import com.volmit.iris.engine.object.annotations.Required;
|
|
||||||
import com.volmit.iris.engine.object.biome.InferredType;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
|
||||||
import com.volmit.iris.engine.object.biome.IrisBiomePaletteLayer;
|
|
||||||
import com.volmit.iris.util.math.RNG;
|
|
||||||
import com.volmit.iris.util.noise.CellGenerator;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Desc("A spot config")
|
|
||||||
@Data
|
|
||||||
public class IrisRegionSpot {
|
|
||||||
@RegistryListResource(IrisBiome.class)
|
|
||||||
@Required
|
|
||||||
@Desc("The biome to be placed")
|
|
||||||
private String biome = "";
|
|
||||||
|
|
||||||
@Required
|
|
||||||
@Desc("Where this spot overrides. Land sea or shore")
|
|
||||||
private InferredType type = InferredType.LAND;
|
|
||||||
|
|
||||||
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
|
|
||||||
private InferredType as = InferredType.DEFER;
|
|
||||||
|
|
||||||
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
|
|
||||||
private double noiseMultiplier = 0;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The scale of splotches")
|
|
||||||
private double scale = 1;
|
|
||||||
|
|
||||||
@Required
|
|
||||||
@MinNumber(1)
|
|
||||||
@Desc("Rarity is how often this splotch appears. higher = less often")
|
|
||||||
private double rarity = 1;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The shuffle or how natural the splotch looks like (anti-polygon)")
|
|
||||||
private double shuffle = 128;
|
|
||||||
|
|
||||||
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
|
|
||||||
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
|
|
||||||
|
|
||||||
private final transient AtomicCache<CellGenerator> spot = new AtomicCache<>();
|
|
||||||
|
|
||||||
public CellGenerator getSpotGenerator(RNG rng) {
|
|
||||||
return spot.aquire(() ->
|
|
||||||
{
|
|
||||||
CellGenerator spot = new CellGenerator(rng.nextParallelRNG((int) (168583 * (shuffle + 102) + rarity + (scale * 10465) + biome.length() + type.ordinal() + as.ordinal())));
|
|
||||||
spot.setCellScale(scale);
|
|
||||||
spot.setShuffle(shuffle);
|
|
||||||
return spot;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getSpotHeight(RNG rng, double x, double z) {
|
|
||||||
if (getNoiseMultiplier() == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getSpotGenerator(rng).getDistance(x, z) * getNoiseMultiplier();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSpot(RNG rng, double x, double z) {
|
|
||||||
return getSpotGenerator(rng).getIndex(x, z, (int) (Math.round(rarity) + 8)) == (int) ((Math.round(rarity) + 8) / 2);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user