Fix up issues with code

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
solonovamax
2020-11-06 22:26:57 -05:00
parent a362ed47ce
commit 0c8c0723ef
130 changed files with 1228 additions and 1059 deletions

View File

@@ -21,21 +21,25 @@ public class TerraBiomeGrid extends BiomeGrid {
public TerraBiomeGrid(World w, double freq1, double freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
super(w, freq1, freq2, 0, 0);
if(c.biomeBlend) {
if (c.biomeBlend) {
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
}
this.zone = zone;
if(c.erosionEnable) {
if (c.erosionEnable) {
erode = new ErosionNoise(c.erosionFreq, c.erosionThresh, c.erosionOctaves, w.getSeed());
this.erosionGrid = erosion;
}
}
public UserDefinedGrid getGrid(int x, int z) {
return (UserDefinedGrid) zone.getGrid(x, z);
}
@Override
public Biome getBiome(int x, int z, GenerationPhase phase) {
int xp = x;
int zp = z;
if(perturb != null && phase.equals(GenerationPhase.PALETTE_APPLY)) {
if (perturb != null && phase.equals(GenerationPhase.PALETTE_APPLY)) {
Vector2 perturbCoords = perturb.getShiftedCoords(x, z);
xp = (int) perturbCoords.getX();
zp = (int) perturbCoords.getZ();
@@ -62,7 +66,5 @@ public class TerraBiomeGrid extends BiomeGrid {
return getBiome(l.getBlockX(), l.getBlockZ(), phase);
}
public UserDefinedGrid getGrid(int x, int z) {
return (UserDefinedGrid) zone.getGrid(x, z);
}
}

View File

@@ -7,6 +7,7 @@ import parsii.tokenizer.ParseException;
/**
* What happens if terrain generation is attempted with an unrecoverable config error.
*/
@SuppressWarnings("unused")
public enum FailType {
/**
* Return failover biome, then shut down server to minimize damage.