Fixed sub biome consistency. Courtesy of Zeno410
This commit is contained in:
parent
d70f767286
commit
621fa583c6
1 changed files with 9 additions and 5 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue