Merge branch 'master' of https://github.com/BiomesOPlenty/BiomesOPlenty
This commit is contained in:
commit
7c7d4f9f1b
5 changed files with 92 additions and 71 deletions
|
@ -10,7 +10,10 @@ import net.minecraft.world.WorldType;
|
|||
import net.minecraft.world.biome.BiomeCache;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.gen.layer.GenLayer;
|
||||
import net.minecraft.world.gen.layer.IntCache;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.terraingen.WorldTypeEvent;
|
||||
import biomesoplenty.api.Biomes;
|
||||
import biomesoplenty.world.layer.BiomeLayer;
|
||||
|
||||
|
@ -18,10 +21,10 @@ import com.google.common.base.Optional;
|
|||
|
||||
public class WorldChunkManagerBOP extends WorldChunkManager
|
||||
{
|
||||
private BiomeLayer genBiomes;
|
||||
private GenLayer genBiomes;
|
||||
|
||||
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
|
||||
private BiomeLayer biomeIndexLayer;
|
||||
private GenLayer biomeIndexLayer;
|
||||
|
||||
/** The BiomeCache object for this world. */
|
||||
private BiomeCache biomeCache;
|
||||
|
@ -102,9 +105,15 @@ public class WorldChunkManagerBOP extends WorldChunkManager
|
|||
public WorldChunkManagerBOP(long par1, WorldType par3WorldType)
|
||||
{
|
||||
this();
|
||||
BiomeLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 0);
|
||||
genBiomes = var4[0];
|
||||
biomeIndexLayer = var4[1];
|
||||
// GenLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 0);
|
||||
|
||||
GenLayer[] agenlayer = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 0);
|
||||
agenlayer = getModdedBiomeGenerators(par3WorldType, par1, agenlayer);
|
||||
|
||||
// genBiomes = var4[0];
|
||||
// biomeIndexLayer = var4[1];
|
||||
genBiomes = agenlayer[0];
|
||||
biomeIndexLayer = agenlayer[1];
|
||||
}
|
||||
|
||||
public WorldChunkManagerBOP(World par1World)
|
||||
|
@ -342,4 +351,11 @@ public class WorldChunkManagerBOP extends WorldChunkManager
|
|||
biomesToSpawnIn.add(biome.get());
|
||||
}
|
||||
}
|
||||
|
||||
public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original)
|
||||
{
|
||||
WorldTypeEvent.InitBiomeGens event = new WorldTypeEvent.InitBiomeGens(worldType, seed, original);
|
||||
MinecraftForge.TERRAIN_GEN_BUS.post(event);
|
||||
return event.newBiomeGens;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.gen.layer.GenLayer;
|
||||
import net.minecraft.world.gen.layer.IntCache;
|
||||
import biomesoplenty.helpers.BiomeCacheBOPhell;
|
||||
import biomesoplenty.world.layer.BiomeLayer;
|
||||
|
@ -16,8 +17,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class WorldChunkManagerBOPhell extends WorldChunkManager
|
||||
{
|
||||
private BiomeLayer genBiomes;
|
||||
private BiomeLayer biomeIndexLayer;
|
||||
private GenLayer genBiomes;
|
||||
private GenLayer biomeIndexLayer;
|
||||
private BiomeCacheBOPhell biomeCache;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
@ -32,7 +33,7 @@ public class WorldChunkManagerBOPhell extends WorldChunkManager
|
|||
public WorldChunkManagerBOPhell(long par1, WorldType par3WorldType)
|
||||
{
|
||||
this();
|
||||
BiomeLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 1);
|
||||
GenLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 1);
|
||||
//var4 = getModdedBiomeGenerators(par3WorldType, par1, var4);
|
||||
genBiomes = var4[0];
|
||||
biomeIndexLayer = var4[1];
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.WorldChunkManager;
|
||||
import net.minecraft.world.gen.layer.GenLayer;
|
||||
import net.minecraft.world.gen.layer.IntCache;
|
||||
import biomesoplenty.helpers.BiomeCachePromised;
|
||||
import biomesoplenty.world.layer.BiomeLayer;
|
||||
|
@ -16,8 +17,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class WorldChunkManagerPromised extends WorldChunkManager
|
||||
{
|
||||
private BiomeLayer genBiomes;
|
||||
private BiomeLayer biomeIndexLayer;
|
||||
private GenLayer genBiomes;
|
||||
private GenLayer biomeIndexLayer;
|
||||
private BiomeCachePromised biomeCache;
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
|
@ -29,7 +30,7 @@ public class WorldChunkManagerPromised extends WorldChunkManager
|
|||
public WorldChunkManagerPromised(long par1, WorldType par3WorldType)
|
||||
{
|
||||
this();
|
||||
BiomeLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 2);
|
||||
GenLayer[] var4 = BiomeLayer.initializeAllBiomeGenerators(par1, par3WorldType, 2);
|
||||
genBiomes = var4[0];
|
||||
biomeIndexLayer = var4[1];
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public class WorldTypeBOP extends WorldType
|
|||
{
|
||||
public WorldTypeBOP() {
|
||||
super(4, "BIOMESOP");
|
||||
this.biomesForWorldType = super.getBiomesForWorldType();
|
||||
this.removeAllBiomes();
|
||||
|
||||
if (BOPConfiguration.alpsGen == true)
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
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
|
||||
public abstract class BiomeLayer extends GenLayer
|
||||
{
|
||||
private long worldGenSeed;
|
||||
protected BiomeLayer parent;
|
||||
private long chunkSeed;
|
||||
private long baseSeed;
|
||||
// private long worldGenSeed;
|
||||
// protected BiomeLayer parent;
|
||||
// private long chunkSeed;
|
||||
// private long baseSeed;
|
||||
|
||||
//dim: 0 = surface, 1 = hell, 2 = promised
|
||||
public static BiomeLayer[] initializeAllBiomeGenerators(long seed, WorldType worldtype, int dim)
|
||||
public static GenLayer[] initializeAllBiomeGenerators(long seed, WorldType worldtype, int dim)
|
||||
{
|
||||
if(dim == 0)
|
||||
{
|
||||
|
@ -54,7 +55,7 @@ public abstract class BiomeLayer
|
|||
BiomeLayerVoronoiZoom genlayervoronoizoom = new BiomeLayerVoronoiZoom(10L, ((obj2)));
|
||||
(obj2).initWorldGenSeed(seed);
|
||||
genlayervoronoizoom.initWorldGenSeed(seed);
|
||||
return (new BiomeLayer[]
|
||||
return (new GenLayer[]
|
||||
{
|
||||
obj2, genlayervoronoizoom, bwg4layerrivermix
|
||||
});
|
||||
|
@ -78,66 +79,67 @@ public abstract class BiomeLayer
|
|||
BiomeLayerVoronoiZoom genlayervoronoizoom = new BiomeLayerVoronoiZoom(10L, ((obj)));
|
||||
(obj).initWorldGenSeed(seed);
|
||||
genlayervoronoizoom.initWorldGenSeed(seed);
|
||||
return (new BiomeLayer[] { obj, genlayervoronoizoom });
|
||||
return (new GenLayer[] { obj, genlayervoronoizoom });
|
||||
}
|
||||
}
|
||||
|
||||
public BiomeLayer(long seed)
|
||||
{
|
||||
baseSeed = seed;
|
||||
baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
baseSeed += seed;
|
||||
baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
baseSeed += seed;
|
||||
baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
baseSeed += seed;
|
||||
super(seed);
|
||||
// baseSeed = seed;
|
||||
// baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// baseSeed += seed;
|
||||
// baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// baseSeed += seed;
|
||||
// baseSeed *= baseSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// baseSeed += seed;
|
||||
}
|
||||
|
||||
public void initWorldGenSeed(long seed)
|
||||
{
|
||||
worldGenSeed = seed;
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
parent.initWorldGenSeed(seed);
|
||||
}
|
||||
|
||||
worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
worldGenSeed += baseSeed;
|
||||
worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
worldGenSeed += baseSeed;
|
||||
worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
worldGenSeed += baseSeed;
|
||||
}
|
||||
|
||||
public void initChunkSeed(long par1, long par3)
|
||||
{
|
||||
chunkSeed = worldGenSeed;
|
||||
chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
chunkSeed += par1;
|
||||
chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
chunkSeed += par3;
|
||||
chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
chunkSeed += par1;
|
||||
chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
chunkSeed += par3;
|
||||
}
|
||||
|
||||
protected int nextInt(int par1)
|
||||
{
|
||||
int j = (int)((chunkSeed >> 24) % par1);
|
||||
|
||||
if (j < 0)
|
||||
{
|
||||
j += par1;
|
||||
}
|
||||
|
||||
chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
chunkSeed += worldGenSeed;
|
||||
return j;
|
||||
}
|
||||
|
||||
public abstract int[] getInts(int i, int j, int k, int l);
|
||||
// public void initWorldGenSeed(long seed)
|
||||
// {
|
||||
// worldGenSeed = seed;
|
||||
//
|
||||
// if (parent != null)
|
||||
// {
|
||||
// parent.initWorldGenSeed(seed);
|
||||
// }
|
||||
//
|
||||
// worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// worldGenSeed += baseSeed;
|
||||
// worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// worldGenSeed += baseSeed;
|
||||
// worldGenSeed *= worldGenSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// worldGenSeed += baseSeed;
|
||||
// }
|
||||
//
|
||||
// public void initChunkSeed(long par1, long par3)
|
||||
// {
|
||||
// chunkSeed = worldGenSeed;
|
||||
// chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// chunkSeed += par1;
|
||||
// chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// chunkSeed += par3;
|
||||
// chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// chunkSeed += par1;
|
||||
// chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// chunkSeed += par3;
|
||||
// }
|
||||
//
|
||||
// protected int nextInt(int par1)
|
||||
// {
|
||||
// int j = (int)((chunkSeed >> 24) % par1);
|
||||
//
|
||||
// if (j < 0)
|
||||
// {
|
||||
// j += par1;
|
||||
// }
|
||||
//
|
||||
// chunkSeed *= chunkSeed * 6364136223846793005L + 1442695040888963407L;
|
||||
// chunkSeed += worldGenSeed;
|
||||
// return j;
|
||||
// }
|
||||
//
|
||||
// public abstract int[] getInts(int i, int j, int k, int l);
|
||||
|
||||
public static byte getModdedBiomeSize(WorldType worldType, byte original)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue