From bd4109f0f2b862e20da26a0862d11929ad34d6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Hrivn=C3=A1k?= Date: Sun, 4 Sep 2022 13:15:51 +0200 Subject: [PATCH] Fix Team-RTG/Realistic-Terrain-Generation#1363 --- .../rtg/api/world/biome/RealisticBiomeBase.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/rtg/api/world/biome/RealisticBiomeBase.java b/src/main/java/rtg/api/world/biome/RealisticBiomeBase.java index 5febe6d34..3d910aa5c 100644 --- a/src/main/java/rtg/api/world/biome/RealisticBiomeBase.java +++ b/src/main/java/rtg/api/world/biome/RealisticBiomeBase.java @@ -63,7 +63,7 @@ public RealisticBiomeBase(@Nonnull final Biome baseBiome, @Nonnull final RiverTy ResourceLocation resloc = baseBiome.getRegistryName(); if (resloc == null) { throw new IllegalStateException(String.format("Biome with ID: %s, of class: %s, does not have a registry name set.", - Biome.getIdForBiome(baseBiome), baseBiome.getClass().getName())); + Biome.getIdForBiome(baseBiome), baseBiome.getClass().getName())); } this.baseBiome = baseBiome; @@ -72,6 +72,10 @@ public RealisticBiomeBase(@Nonnull final Biome baseBiome, @Nonnull final RiverTy this.riverType = riverType; this.beachType = beachType; this.config = new BiomeConfig(getConfigFile()); + + initConfig(); + getConfig().loadConfig(); + this.terrain = initTerrain(); this.surface = initSurface(); this.surfaceRiver = new SurfaceRiverOasis(config); @@ -81,12 +85,7 @@ public RealisticBiomeBase(@Nonnull final Biome baseBiome, @Nonnull final RiverTy this.decos = new ArrayList<>(); this.rtgTrees = new ArrayList<>(); - initConfig(); - - getConfig().loadConfig(); - initDecos(); - overrideDecorations(); } @@ -217,7 +216,7 @@ public float erodedNoise(RTGWorld rtgWorld, int x, int y, float river, float bor float irregularity = rtgWorld.simplexInstance(0).noise2f(x / 12f, y / 12f) * 2f + rtgWorld.simplexInstance(0).noise2f(x / 8f, y / 8f); // less on the bottom and more on the sides irregularity = irregularity * (1 + r); - return (biomeHeight * (r)) + ((55f + irregularity) * 1.0f) * (1f - r); + return (biomeHeight * (r)) + ((55f + irregularity)) * (1f - r); } else { return biomeHeight;