Remove lakes & shores

This commit is contained in:
cyberpwn 2021-08-27 04:40:06 -04:00
parent 109390d21e
commit fcc3bbf9b6
6 changed files with 4 additions and 129 deletions

View File

@ -103,8 +103,6 @@ public class IrisComplex implements DataProvider {
case SHORE: case SHORE:
return shoreBiomeStream; return shoreBiomeStream;
case DEFER: case DEFER:
case LAKE:
case RIVER:
default: default:
break; break;
} }

View File

@ -34,12 +34,6 @@ public enum InferredType {
@Desc("Represents any cave biome type") @Desc("Represents any cave biome type")
CAVE, CAVE,
@Desc("Represents any river biome type")
RIVER,
@Desc("Represents any lake biome type")
LAKE,
@Desc("Defers the type to whatever another biome type that already exists is.") @Desc("Defers the type to whatever another biome type that already exists is.")
DEFER DEFER
} }

View File

@ -548,22 +548,8 @@ public class IrisBiome extends IrisRegistrant implements IRare {
return inferredType.equals(InferredType.SEA); return inferredType.equals(InferredType.SEA);
} }
public boolean isLake() {
if (inferredType == null) {
return false;
}
return inferredType.equals(InferredType.LAKE);
}
public boolean isRiver() {
if (inferredType == null) {
return false;
}
return inferredType.equals(InferredType.RIVER);
}
public boolean isAquatic() { public boolean isAquatic() {
return isSea() || isLake() || isRiver(); return isSea();
} }
@SuppressWarnings("BooleanMethodIsAlwaysInverted") @SuppressWarnings("BooleanMethodIsAlwaysInverted")

View File

@ -173,21 +173,6 @@ public class IrisDimension extends IrisRegistrant {
@Desc("The placement style of biomes") @Desc("The placement style of biomes")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style(); private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle riverBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle lakeBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeChanceStyle = NoiseStyle.CELLULAR_HEIGHT_IRIS_DOUBLE.style();
@Desc("The placement style of biomes")
private IrisGeneratorStyle skylandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("Generate caves or not.") @Desc("Generate caves or not.")
private boolean caves = true; private boolean caves = true;
@ -452,10 +437,6 @@ public class IrisDimension extends IrisRegistrant {
switch (type) { switch (type) {
case CAVE: case CAVE:
return caveBiomeStyle; return caveBiomeStyle;
case LAKE:
return lakeBiomeStyle;
case RIVER:
return riverBiomeStyle;
case LAND: case LAND:
return landBiomeStyle; return landBiomeStyle;
case SEA: case SEA:

View File

@ -128,14 +128,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
@Desc("How large shore biomes are in this region") @Desc("How large shore biomes are in this region")
private double shoreBiomeZoom = 1; private double shoreBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large lake biomes are in this region")
private double lakeBiomeZoom = 1;
@MinNumber(0.0001)
@Desc("How large river biomes are in this region")
private double riverBiomeZoom = 1;
@MinNumber(0.0001) @MinNumber(0.0001)
@Desc("How large sea biomes are in this region") @Desc("How large sea biomes are in this region")
private double seaBiomeZoom = 1; private double seaBiomeZoom = 1;
@ -167,16 +159,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> shoreBiomes = new KList<>(); private KList<String> shoreBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@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> riverBiomes = new KList<>();
@RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class)
@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> lakeBiomes = new KList<>();
@RegistryListResource(IrisBiome.class) @RegistryListResource(IrisBiome.class)
@ArrayType(min = 1, type = String.class) @ArrayType(min = 1, type = String.class)
@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.")
@ -275,42 +257,10 @@ public class IrisRegion extends IrisRegistrant implements IRare {
}); });
} }
public boolean isRiver(RNG rng, double x, double z) {
if (!isRivers()) {
return false;
}
if (getRiverBiomes().isEmpty()) {
return false;
}
if (getRiverChanceGen().aquire(() -> getRiverChanceStyle().create(rng, getLoader())).fit(1, getRiverRarity(), x, z) != 1) {
return false;
}
return getRiverGen().aquire(() -> getRiverStyle().create(rng, getLoader())).fitDouble(0, 1, x, z) < getRiverThickness();
}
public boolean isLake(RNG rng, double x, double z) {
if (!isLakes()) {
return false;
}
if (getLakeBiomes().isEmpty()) {
return false;
}
return getLakeGen().aquire(() -> getLakeStyle().create(rng, getLoader())).fit(1, getLakeRarity(), x, z) == 1;
}
public double getBiomeZoom(InferredType t) { public double getBiomeZoom(InferredType t) {
switch (t) { switch (t) {
case CAVE: case CAVE:
return caveBiomeZoom; return caveBiomeZoom;
case LAKE:
return lakeBiomeZoom;
case RIVER:
return riverBiomeZoom;
case LAND: case LAND:
return landBiomeZoom; return landBiomeZoom;
case SEA: case SEA:
@ -358,8 +308,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);
names.addAll(riverBiomes);
names.addAll(lakeBiomes);
spotBiomes.forEach((i) -> names.add(i.getBiome())); spotBiomes.forEach((i) -> names.add(i.getBiome()));
ridgeBiomes.forEach((i) -> names.add(i.getBiome())); ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
@ -402,10 +350,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
return getRealShoreBiomes(g); return getRealShoreBiomes(g);
} else if (type.equals(InferredType.CAVE)) { } else if (type.equals(InferredType.CAVE)) {
return getRealCaveBiomes(g); return getRealCaveBiomes(g);
} else if (type.equals(InferredType.LAKE)) {
return getRealLakeBiomes(g);
} else if (type.equals(InferredType.RIVER)) {
return getRealRiverBiomes(g);
} }
return new KList<>(); return new KList<>();
@ -424,32 +368,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
}); });
} }
public KList<IrisBiome> getRealLakeBiomes(DataProvider g) {
return realLakeBiomes.aquire(() ->
{
KList<IrisBiome> realLakeBiomes = new KList<>();
for (String i : getLakeBiomes()) {
realLakeBiomes.add(g.getData().getBiomeLoader().load(i));
}
return realLakeBiomes;
});
}
public KList<IrisBiome> getRealRiverBiomes(DataProvider g) {
return realRiverBiomes.aquire(() ->
{
KList<IrisBiome> realRiverBiomes = new KList<>();
for (String i : getRiverBiomes()) {
realRiverBiomes.add(g.getData().getBiomeLoader().load(i));
}
return realRiverBiomes;
});
}
public KList<IrisBiome> getRealShoreBiomes(DataProvider g) { public KList<IrisBiome> getRealShoreBiomes(DataProvider g) {
return realShoreBiomes.aquire(() -> return realShoreBiomes.aquire(() ->
{ {
@ -496,8 +414,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);
names.addAll(riverBiomes);
names.addAll(lakeBiomes);
spotBiomes.forEach((i) -> names.add(i.getBiome())); spotBiomes.forEach((i) -> names.add(i.getBiome()));
ridgeBiomes.forEach((i) -> names.add(i.getBiome())); ridgeBiomes.forEach((i) -> names.add(i.getBiome()));

View File

@ -79,17 +79,17 @@ public class IrisSpawner extends IrisRegistrant {
public boolean isValid(IrisBiome biome) { public boolean isValid(IrisBiome biome) {
return switch (group) { return switch (group) {
case NORMAL -> switch (biome.getInferredType()) { case NORMAL -> switch (biome.getInferredType()) {
case SHORE, SEA, CAVE, RIVER, LAKE, DEFER -> false; case SHORE, SEA, CAVE, DEFER -> false;
case LAND -> true; case LAND -> true;
}; };
case CAVE -> true; case CAVE -> true;
case UNDERWATER -> switch (biome.getInferredType()) { case UNDERWATER -> switch (biome.getInferredType()) {
case SHORE, LAND, CAVE, RIVER, LAKE, DEFER -> false; case SHORE, LAND, CAVE, DEFER -> false;
case SEA -> true; case SEA -> true;
}; };
case BEACH -> switch (biome.getInferredType()) { case BEACH -> switch (biome.getInferredType()) {
case SHORE -> true; case SHORE -> true;
case LAND, CAVE, RIVER, LAKE, SEA, DEFER -> false; case LAND, CAVE, SEA, DEFER -> false;
}; };
}; };
} }