Some value changes.

Largely untested.
This commit is contained in:
Harrison Deng 2020-04-24 00:02:11 -05:00
parent 1b5a03d72a
commit 88c645e2a5
2 changed files with 13 additions and 13 deletions

View File

@ -6,7 +6,7 @@ import org.bukkit.util.noise.SimplexOctaveGenerator;
class TemperatureMapGenerator {
private final double frequency = 0.5D;
private final double amplitude = 0.22D;
private final double amplitude = 0.5D;
private SimplexOctaveGenerator noiseGenerator;

View File

@ -20,7 +20,7 @@ public class WorldHeightShader {
public WorldHeightShader(long seed, IslandWorldMapper islandLocator, int seaLevel, int worldHeight, int minimumHeight) {
random = new Random(seed);
noiseGenerator = new SimplexOctaveGenerator(random, 2);
noiseGenerator.setScale(0.05D);
noiseGenerator.setScale(0.075D);
this.islandLocator = islandLocator;
this.seaLevel = seaLevel;
this.worldHeight = worldHeight;
@ -31,26 +31,26 @@ public class WorldHeightShader {
double modifier = getHeightModifier(worldX, worldZ);
int baseValue = calculateTerrainHeight(worldX, worldZ);
int height = 0;
String biomeName = biome.name();
String biomeName = biome.name().toLowerCase();
if (biomeName.contains("hills")) {
height = (int) (modifier * 40D + baseValue);
height = (int) (modifier * 20D + baseValue);
} else if (biomeName.contains("mountains")) {
height = (int) (modifier * 70D + baseValue);
height = (int) (modifier * 45D + baseValue);
} else if (biomeName.contains("plateau")) {
height = (int) (Math.min(60, Math.max(2, modifier * 80D)) + baseValue);
} else if (biomeName.contains("modified")) {
height = (int) (modifier * 50D + baseValue);
height = (int) (modifier * 25D + baseValue);
} else if (biomeName.contains("shattered")) {
height = (int) (modifier * 60D + baseValue);
height = (int) (modifier * 35D + baseValue);
} else if (biomeName.contains("tall")) {
height = (int) (modifier * 55D + baseValue);
height = (int) (modifier * 30D + baseValue);
} else if (!biomeName.contains("ocean")) {
height = (int) (getNormalizedHeightModifier(worldX, worldZ) * 20D + baseValue);
height = (int) (getNormalizedHeightModifier(worldX, worldZ) * 15D + baseValue);
} else {
height = (int) (getNormalizedHeightModifier(worldX, worldZ) * 10D + baseValue);
height = (int) (getNormalizedHeightModifier(worldX, worldZ) * 5D + baseValue);
}
if (height > worldHeight) throw new InvalidAlgorithmParameterException("Resulting height is greater than world height!!!");
if (height > worldHeight) throw new InvalidAlgorithmParameterException("Resulting height is greater than world height!!! Biome: " + biomeName);
return height;
}
@ -59,7 +59,7 @@ public class WorldHeightShader {
if (islandValue >= 0) {
return seaLevel;
}
return (int) Math.max(-islandValue * seaLevel, minimumHeight);
return (int) Math.max((- islandValue) * seaLevel, minimumHeight);
}
private double getHeightModifier(int worldX, int worldZ) {
@ -79,6 +79,6 @@ public class WorldHeightShader {
if (heightModifier > 0) {
return heightModifier / maxHeightModifier();
}
return minHeightModifier();
return - heightModifier / minHeightModifier();
}
}