fixed missing snow

This commit is contained in:
ted80-PC 2013-05-09 10:48:24 +02:00
parent 2eff5c0e98
commit 96ea682660
3 changed files with 102 additions and 7 deletions

View file

@ -358,7 +358,6 @@ public class ChunkProviderBOP implements IChunkProvider
* generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the
* size. * size.
*/ */
@SuppressWarnings("unused")
private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)
{ {
ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7); ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);
@ -585,6 +584,28 @@ public class ChunkProviderBOP implements IChunkProvider
biomegenbase.decorate(this.worldObj, this.rand, k, l); biomegenbase.decorate(this.worldObj, this.rand, k, l);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
k += 8;
l += 8;
doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ICE);
for (k1 = 0; doGen && k1 < 16; ++k1)
{
for (l1 = 0; l1 < 16; ++l1)
{
i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1);
if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l))
{
this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Block.ice.blockID, 0, 2);
}
if (this.worldObj.canSnowAt(k1 + k, i2, l1 + l))
{
this.worldObj.setBlock(k1 + k, i2, l1 + l, Block.snow.blockID, 0, 2);
}
}
}
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
BlockSand.fallInstantly = false; BlockSand.fallInstantly = false;

View file

@ -15,21 +15,22 @@ public abstract class BiomeLayer
public static BiomeLayer[] initializeAllBiomeGenerators(long seed, WorldType worldtype) public static BiomeLayer[] initializeAllBiomeGenerators(long seed, WorldType worldtype)
{ {
BiomeLayer obj = new BiomeLayerCreate(1L); BiomeLayer obj = new BiomeLayerCreate(1L);
obj = new BiomeLayerFuzzyZoom(2000L, (BiomeLayer)(obj));
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
{ {
obj = new BiomeLayerZoom(2000L + i, (BiomeLayer)(obj)); obj = new BiomeLayerZoom(2000L + i, (BiomeLayer)(obj));
} }
BiomeLayer obj2 = obj; obj = BiomeLayerZoom.func_75915_a(1000L, ((BiomeLayer)(obj)), 0);
obj2 = new BiomeLayerZoom(1000L, (BiomeLayer)(obj2)); obj = new BiomeLayerBiomes(200L, ((BiomeLayer)(obj)), worldtype);
obj2 = new BiomeLayerBiomes(200L, ((BiomeLayer)(obj2)), worldtype); obj = BiomeLayerZoom.func_75915_a(1000L, ((BiomeLayer)(obj)), 2);
BiomeLayerVoronoiZoom genlayervoronoizoom = new BiomeLayerVoronoiZoom(10L, ((BiomeLayer)(obj2))); BiomeLayerVoronoiZoom genlayervoronoizoom = new BiomeLayerVoronoiZoom(10L, ((BiomeLayer)(obj)));
((BiomeLayer)(obj2)).initWorldGenSeed(seed); ((BiomeLayer)(obj)).initWorldGenSeed(seed);
genlayervoronoizoom.initWorldGenSeed(seed); genlayervoronoizoom.initWorldGenSeed(seed);
return (new BiomeLayer[] { obj2, genlayervoronoizoom }); return (new BiomeLayer[] { obj, genlayervoronoizoom }); //genlayervoronoizoom
} }
public BiomeLayer(long seed) public BiomeLayer(long seed)

View file

@ -0,0 +1,73 @@
package biomesoplenty.world.layer;
public class BiomeLayerFuzzyZoom extends BiomeLayer
{
public BiomeLayerFuzzyZoom(long par1, BiomeLayer par3GenLayer)
{
super(par1);
super.parent = par3GenLayer;
}
/**
* Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
* amounts, or biomeList[] indices based on the particular GenLayer subclass.
*/
public int[] getInts(int par1, int par2, int par3, int par4)
{
int i1 = par1 >> 1;
int j1 = par2 >> 1;
int k1 = (par3 >> 1) + 3;
int l1 = (par4 >> 1) + 3;
int[] aint = this.parent.getInts(i1, j1, k1, l1);
int[] aint1 = LayerIntCache.getIntCache(k1 * 2 * l1 * 2);
int i2 = k1 << 1;
int j2;
for (int k2 = 0; k2 < l1 - 1; ++k2)
{
j2 = k2 << 1;
int l2 = j2 * i2;
int i3 = aint[0 + (k2 + 0) * k1];
int j3 = aint[0 + (k2 + 1) * k1];
for (int k3 = 0; k3 < k1 - 1; ++k3)
{
this.initChunkSeed((long)(k3 + i1 << 1), (long)(k2 + j1 << 1));
int l3 = aint[k3 + 1 + (k2 + 0) * k1];
int i4 = aint[k3 + 1 + (k2 + 1) * k1];
aint1[l2] = i3;
aint1[l2++ + i2] = this.choose(i3, j3);
aint1[l2] = this.choose(i3, l3);
aint1[l2++ + i2] = this.choose(i3, l3, j3, i4);
i3 = l3;
j3 = i4;
}
}
int[] aint2 = LayerIntCache.getIntCache(par3 * par4);
for (j2 = 0; j2 < par4; ++j2)
{
System.arraycopy(aint1, (j2 + (par2 & 1)) * (k1 << 1) + (par1 & 1), aint2, j2 * par3, par3);
}
return aint2;
}
/**
* randomly choose between the two args
*/
protected int choose(int par1, int par2)
{
return this.nextInt(2) == 0 ? par1 : par2;
}
/**
* randomly choose between the four args
*/
protected int choose(int par1, int par2, int par3, int par4)
{
int i1 = this.nextInt(4);
return i1 == 0 ? par1 : (i1 == 1 ? par2 : (i1 == 2 ? par3 : par4));
}
}