Override river mix gen layer, improve polar regions with frozen rivers, and arctic regions in the frozen oceans
This commit is contained in:
parent
3f38fd5be5
commit
f183391144
4 changed files with 91 additions and 3 deletions
|
@ -161,7 +161,7 @@ public class WorldChunkManagerBOP extends WorldChunkManager
|
||||||
riversBranch = new GenLayerSmooth(1000L, riversBranch);
|
riversBranch = new GenLayerSmooth(1000L, riversBranch);
|
||||||
|
|
||||||
// mix rivers into main branch
|
// mix rivers into main branch
|
||||||
GenLayer riverMixFinal = new GenLayerRiverMix(100L, mainBranch, riversBranch);
|
GenLayer riverMixFinal = new GenLayerRiverMixBOP(100L, mainBranch, riversBranch);
|
||||||
|
|
||||||
// finish biomes with Voronoi zoom
|
// finish biomes with Voronoi zoom
|
||||||
GenLayer biomesFinal = new GenLayerVoronoiZoom(10L, riverMixFinal);
|
GenLayer biomesFinal = new GenLayerVoronoiZoom(10L, riverMixFinal);
|
||||||
|
|
|
@ -77,7 +77,13 @@ public class GenLayerHeatLatitude extends GenLayer
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// ICY
|
// ICY
|
||||||
out[x + y * areaWidth] = ((parentVal == 0) ? BiomeGenBase.frozenOcean.biomeID : 4);
|
// change 50% of ocean to frozen ocean, the other 50% pick random ICY biomes - too much frozen ocean is very boring
|
||||||
|
if (parentVal == 0 && this.nextInt(2) == 0)
|
||||||
|
{
|
||||||
|
out[x + y * areaWidth] = BiomeGenBase.frozenOcean.biomeID;
|
||||||
|
} else {
|
||||||
|
out[x + y * areaWidth] = 4;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright 2015, the Biomes O' Plenty Team
|
||||||
|
*
|
||||||
|
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||||
|
*
|
||||||
|
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
package biomesoplenty.common.world.layer;
|
||||||
|
|
||||||
|
import biomesoplenty.api.biome.BOPBiomes;
|
||||||
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
|
import net.minecraft.world.gen.layer.GenLayer;
|
||||||
|
import net.minecraft.world.gen.layer.IntCache;
|
||||||
|
|
||||||
|
public class GenLayerRiverMixBOP extends GenLayer
|
||||||
|
{
|
||||||
|
private GenLayer biomesBranch;
|
||||||
|
private GenLayer riversBranch;
|
||||||
|
|
||||||
|
public GenLayerRiverMixBOP(long seed, GenLayer biomesBranch, GenLayer riversBranch)
|
||||||
|
{
|
||||||
|
super(seed);
|
||||||
|
this.biomesBranch = biomesBranch;
|
||||||
|
this.riversBranch = riversBranch;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initWorldGenSeed(long worldSeed)
|
||||||
|
{
|
||||||
|
this.biomesBranch.initWorldGenSeed(worldSeed);
|
||||||
|
this.riversBranch.initWorldGenSeed(worldSeed);
|
||||||
|
super.initWorldGenSeed(worldSeed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
|
||||||
|
{
|
||||||
|
int[] biomeIds = this.biomesBranch.getInts(areaX, areaY, areaWidth, areaHeight);
|
||||||
|
int[] riverValues = this.riversBranch.getInts(areaX, areaY, areaWidth, areaHeight);
|
||||||
|
int[] out = IntCache.getIntCache(areaWidth * areaHeight);
|
||||||
|
|
||||||
|
for (int i = 0; i < areaWidth * areaHeight; ++i)
|
||||||
|
{
|
||||||
|
if (biomeIds[i] != BiomeGenBase.frozenOcean.biomeID && biomeIds[i] != BiomeGenBase.ocean.biomeID && biomeIds[i] != BiomeGenBase.deepOcean.biomeID)
|
||||||
|
{
|
||||||
|
if (riverValues[i] == BiomeGenBase.river.biomeID)
|
||||||
|
{
|
||||||
|
if (biomeIds[i] == BiomeGenBase.icePlains.biomeID || (BOPBiomes.arctic.isPresent() && biomeIds[i] == BOPBiomes.arctic.get().biomeID))
|
||||||
|
{
|
||||||
|
out[i] = BiomeGenBase.frozenRiver.biomeID;
|
||||||
|
}
|
||||||
|
else if (biomeIds[i] != BiomeGenBase.mushroomIsland.biomeID && biomeIds[i] != BiomeGenBase.mushroomIslandShore.biomeID)
|
||||||
|
{
|
||||||
|
out[i] = riverValues[i] & 255;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out[i] = BiomeGenBase.mushroomIslandShore.biomeID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out[i] = biomeIds[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out[i] = biomeIds[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
package biomesoplenty.common.world.layer;
|
package biomesoplenty.common.world.layer;
|
||||||
|
|
||||||
|
import biomesoplenty.api.biome.BOPBiomes;
|
||||||
import net.minecraft.world.biome.BiomeGenBase;
|
import net.minecraft.world.biome.BiomeGenBase;
|
||||||
import net.minecraft.world.gen.layer.GenLayer;
|
import net.minecraft.world.gen.layer.GenLayer;
|
||||||
import net.minecraft.world.gen.layer.IntCache;
|
import net.minecraft.world.gen.layer.IntCache;
|
||||||
|
@ -230,7 +231,13 @@ public class GenLayerSubBiomesBOP extends GenLayer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add BOP sub biomes here
|
// BOP sub biomes from here on
|
||||||
|
|
||||||
|
if (biomeId == BiomeGenBase.frozenOcean.biomeID && BOPBiomes.arctic.isPresent())
|
||||||
|
{
|
||||||
|
biomeId = BOPBiomes.arctic.get().biomeID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return biomeId;
|
return biomeId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue