BiomesOPlenty/common/biomesoplenty/world/layer/BiomeLayerRiverMix.java

62 lines
1.7 KiB
Java
Raw Normal View History

package biomesoplenty.world.layer;
import biomesoplenty.api.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.IntCache;
public class BiomeLayerRiverMix extends BiomeLayer
{
2013-05-31 10:34:02 +00:00
private BiomeLayer biomePatternGeneratorChain;
private BiomeLayer riverPatternGeneratorChain;
2013-05-31 10:34:02 +00:00
public BiomeLayerRiverMix(long par1, BiomeLayer par3GenLayer, BiomeLayer par4GenLayer)
{
super(par1);
biomePatternGeneratorChain = par3GenLayer;
riverPatternGeneratorChain = par4GenLayer;
}
2013-05-31 10:34:02 +00:00
@Override
public void initWorldGenSeed(long par1)
{
biomePatternGeneratorChain.initWorldGenSeed(par1);
riverPatternGeneratorChain.initWorldGenSeed(par1);
super.initWorldGenSeed(par1);
}
2013-05-31 10:34:02 +00:00
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = biomePatternGeneratorChain.getInts(par1, par2, par3, par4);
int[] var6 = riverPatternGeneratorChain.getInts(par1, par2, par3, par4);
int[] var7 = IntCache.getIntCache(par3 * par4);
2013-05-31 10:34:02 +00:00
for (int var8 = 0; var8 < par3 * par4; ++var8)
{
if (var5[var8] == BiomeGenBase.ocean.biomeID || var5[var8] == Biomes.oceanAbyss.get().biomeID || var5[var8] == Biomes.oceanCoral.get().biomeID || var5[var8] == Biomes.oceanKelp.get().biomeID)
2013-05-31 10:34:02 +00:00
{
var7[var8] = var5[var8];
}
else if (var6[var8] >= 0)
{
if (var5[var8] == BiomeGenBase.icePlains.biomeID)
{
var7[var8] = BiomeGenBase.frozenRiver.biomeID;
}
else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID)
{
var7[var8] = var6[var8];
}
else
{
var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID;
}
}
else
{
var7[var8] = var5[var8];
}
}
return var7;
}
}