Fixed sub biome consistency. Courtesy of Zeno410

This commit is contained in:
Adubbz 2014-06-30 06:24:23 +10:00
parent d70f767286
commit 621fa583c6

View file

@ -24,6 +24,8 @@ public class GenLayerSubBiome extends GenLayer
super(seed); super(seed);
this.parent = parent; this.parent = parent;
this.setOffsets();
} }
@Override @Override
@ -64,12 +66,14 @@ public class GenLayerSubBiome extends GenLayer
private Pair<Integer, Integer> getOffset(BiomeGenBase biome) private Pair<Integer, Integer> getOffset(BiomeGenBase biome)
{ {
Pair<Integer, Integer> offset = offsets[biome.biomeID]; return offsets[biome.biomeID];
}
if (offset != null) return offset; private void setOffsets()
else {
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));
} }
} }
} }