Added sub biome layer

This commit is contained in:
ted80-Laptop 2013-07-08 11:22:46 +02:00
parent 2da69a9eeb
commit e502c5ec6f
2 changed files with 58 additions and 1 deletions

View file

@ -40,7 +40,7 @@ public abstract class BiomeLayer extends GenLayer
obj2 = BiomeLayerZoom.func_75915_a(1000L, ((obj2)), 0);
obj2 = new BiomeLayerBiomes(200L, ((obj2)), worldtype, 0);
obj2 = BiomeLayerZoom.func_75915_a(1000L, ((obj2)), 2);
//obj2 = new BWG4LayerHills(1000L, ((BiomeLayer)(obj2)), generatorSettings);
obj2 = new BiomeLayerSub(1000L, ((BiomeLayer)(obj2)));
obj2 = new BiomeLayerZoom(1000, ((obj2)));
obj2 = new BiomeLayerShore(1000L, ((BiomeLayer)(obj2)));

View file

@ -0,0 +1,57 @@
package biomesoplenty.world.layer;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
public class BiomeLayerSub extends BiomeLayer
{
public BiomeLayerSub(long par1, GenLayer par3GenLayer)
{
super(par1);
this.parent = par3GenLayer;
}
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] aint = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
int[] aint1 = IntCache.getIntCache(par3 * par4);
for (int i1 = 0; i1 < par4; ++i1)
{
for (int j1 = 0; j1 < par3; ++j1)
{
this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
int k1 = aint[j1 + 1 + (i1 + 1) * (par3 + 2)];
int l1 = k1;
//LIST
if (k1 == BiomeGenBase.desert.biomeID && nextInt(3) == 0) { l1 = BiomeGenBase.desertHills.biomeID; }
if (l1 == k1)
{
aint1[j1 + i1 * par3] = k1;
}
else
{
int i2 = aint[j1 + 1 + (i1 + 1 - 1) * (par3 + 2)];
int j2 = aint[j1 + 1 + 1 + (i1 + 1) * (par3 + 2)];
int k2 = aint[j1 + 1 - 1 + (i1 + 1) * (par3 + 2)];
int l2 = aint[j1 + 1 + (i1 + 1 + 1) * (par3 + 2)];
if (i2 == k1 && j2 == k1 && k2 == k1 && l2 == k1)
{
aint1[j1 + i1 * par3] = l1;
}
else
{
aint1[j1 + i1 * par3] = k1;
}
}
}
}
return aint1;
}
}