86 lines
2.8 KiB
Java
86 lines
2.8 KiB
Java
|
package biomesoplenty.world.layer;
|
||
|
|
||
|
import net.minecraft.world.WorldType;
|
||
|
import net.minecraft.world.gen.layer.GenLayer;
|
||
|
import net.minecraftforge.common.MinecraftForge;
|
||
|
import net.minecraftforge.event.terraingen.WorldTypeEvent;
|
||
|
|
||
|
public abstract class BiomeLayer
|
||
|
{
|
||
|
private long worldGenSeed;
|
||
|
protected BiomeLayer parent;
|
||
|
private long chunkSeed;
|
||
|
private long baseSeed;
|
||
|
|
||
|
public static BiomeLayer[] initializeAllBiomeGenerators(long seed, WorldType worldtype)
|
||
|
{
|
||
|
BiomeLayer obj = new BiomeLayerCreate(1L);
|
||
|
|
||
|
return new BiomeLayer[] {};
|
||
|
}
|
||
|
|
||
|
public BiomeLayer(long seed)
|
||
|
{
|
||
|
this.baseSeed = seed;
|
||
|
this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.baseSeed += seed;
|
||
|
this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.baseSeed += seed;
|
||
|
this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.baseSeed += seed;
|
||
|
}
|
||
|
|
||
|
public void initWorldGenSeed(long seed)
|
||
|
{
|
||
|
this.worldGenSeed = seed;
|
||
|
|
||
|
if (this.parent != null)
|
||
|
{
|
||
|
this.parent.initWorldGenSeed(seed);
|
||
|
}
|
||
|
|
||
|
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.worldGenSeed += this.baseSeed;
|
||
|
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.worldGenSeed += this.baseSeed;
|
||
|
this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.worldGenSeed += this.baseSeed;
|
||
|
}
|
||
|
|
||
|
public void initChunkSeed(long par1, long par3)
|
||
|
{
|
||
|
this.chunkSeed = this.worldGenSeed;
|
||
|
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.chunkSeed += par1;
|
||
|
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.chunkSeed += par3;
|
||
|
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.chunkSeed += par1;
|
||
|
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.chunkSeed += par3;
|
||
|
}
|
||
|
|
||
|
protected int nextInt(int par1)
|
||
|
{
|
||
|
int j = (int)((this.chunkSeed >> 24) % (long)par1);
|
||
|
|
||
|
if (j < 0)
|
||
|
{
|
||
|
j += par1;
|
||
|
}
|
||
|
|
||
|
this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||
|
this.chunkSeed += this.worldGenSeed;
|
||
|
return j;
|
||
|
}
|
||
|
|
||
|
public abstract int[] getInts(int i, int j, int k, int l);
|
||
|
|
||
|
public static byte getModdedBiomeSize(WorldType worldType, byte original)
|
||
|
{
|
||
|
WorldTypeEvent.BiomeSize event = new WorldTypeEvent.BiomeSize(worldType, original);
|
||
|
MinecraftForge.TERRAIN_GEN_BUS.post(event);
|
||
|
return event.newSize;
|
||
|
}
|
||
|
}
|