From 621fa583c69585d83a70945e2f36059d20010f17 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 30 Jun 2014 06:24:23 +1000 Subject: [PATCH] Fixed sub biome consistency. Courtesy of Zeno410 --- .../common/world/layer/GenLayerSubBiome.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerSubBiome.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerSubBiome.java index fe6070af8..75f4e404f 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerSubBiome.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerSubBiome.java @@ -24,6 +24,8 @@ public class GenLayerSubBiome extends GenLayer super(seed); this.parent = parent; + + this.setOffsets(); } @Override @@ -64,12 +66,14 @@ public class GenLayerSubBiome extends GenLayer private Pair getOffset(BiomeGenBase biome) { - Pair offset = offsets[biome.biomeID]; - - if (offset != null) return offset; - else + return offsets[biome.biomeID]; + } + + private void setOffsets() + { + for (int i = 0; i< offsets.length; i++) { - return offsets[biome.biomeID] = Pair.of(this.nextInt(OFFSET_RANGE) - (OFFSET_RANGE / 2), this.nextInt(OFFSET_RANGE) - (OFFSET_RANGE / 2)); + offsets[i] = Pair.of(this.nextInt(OFFSET_RANGE) - (OFFSET_RANGE / 2), this.nextInt(OFFSET_RANGE) - (OFFSET_RANGE / 2)); } } }