本文整理匯總了Java中net.minecraftforge.event.terraingen.TerrainGen類的典型用法代碼示例。如果您正苦於以下問題:Java TerrainGen類的具體用法?Java TerrainGen怎麽用?Java TerrainGen使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TerrainGen類屬於net.minecraftforge.event.terraingen包,在下文中一共展示了TerrainGen類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateOres
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
/**
* Generates ores in the current chunk
*/
protected void generateOres()
{
MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT))
this.genStandardOre3(20, this.dark_dirtGen, 0, 256);
if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL))
this.genStandardOre3(10, this.dark_gravelGen, 0, 256);
if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL))
this.genStandardOre3(20, this.dark_coalGen, 0, 128);
if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON))
this.genStandardOre3(20, this.dark_ironGen, 0, 64);
if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD))
this.genStandardOre3(2, this.dark_goldGen, 0, 32);
if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND))
this.genStandardOre3(1, this.dark_diamondGen, 0, 16);
MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
}
示例2: growTree
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
/**
* Attempts to grow a sapling into a tree
*/
public void growTree(World world, int x, int y, int z, Random rand)
{
if (!TerrainGen.saplingGrowTree(world, rand, x, y, z)) return;
int l = world.getBlockMetadata(x, y, z) & 3;
Object object = null;
int i1 = 0;
int j1 = 0;
boolean flag = false;
if (l == 1)
{
object = new WorldGenEbony(true);
}
else
{
object = new WorldGenIronbarkTree(true);
}
world.setBlock(x, y, z, 0, 0, 4);
if (!((WorldGenerator)object).generate(world, rand, x + i1, y, z + j1))
{
world.setBlock(x, y, z, this.blockID, l, 4);
}
}
示例3: growTree
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
/**
* Attempts to grow a sapling into a tree
*/
public void growTree(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!TerrainGen.saplingGrowTree(par1World, par5Random, par2, par3, par4)) return;
int l = par1World.getBlockMetadata(par2, par3, par4) & 3;
Object object = null;
int i1 = 0;
int j1 = 0;
boolean flag = false;
object = new WorldGenCustomTree(true);
par1World.setBlock(par2, par3, par4, 0, 0, 4);
if (!((WorldGenerator)object).generate(par1World, par5Random, par2 + i1, par3, par4 + j1))
{
par1World.setBlock(par2, par3, par4, this.blockID, l, 4);
}
}
示例4: ChunkProviderCustomDimension
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderCustomDimension(World worldObj, long seed, boolean features){
this.worldObj = worldObj;
this.mapFeaturesEnabled = features;
this.rand = new Random(seed);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
noiseGens = TerrainGen.getModdedNoiseGenerators(worldObj, rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
}
示例5: ChunkProviderRune2
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderRune2(World par1World, long par2)
{
this.worldObj = par1World;
this.hellRNG = new Random(par2);
this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16);
this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16);
this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8);
this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10);
this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16);
NoiseGeneratorOctaves[] noiseGens = {netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7};
noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.hellRNG, noiseGens);
this.netherNoiseGen1 = noiseGens[0];
this.netherNoiseGen2 = noiseGens[1];
this.netherNoiseGen3 = noiseGens[2];
this.slowsandGravelNoiseGen = noiseGens[3];
this.netherrackExculsivityNoiseGen = noiseGens[4];
this.netherNoiseGen6 = noiseGens[5];
this.netherNoiseGen7 = noiseGens[6];
}
示例6: growTree
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
/**
* Attempts to grow a sapling into a tree
*/
public void growTree(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!TerrainGen.saplingGrowTree(par1World, par5Random, par2, par3, par4)) return;
int l = par1World.getBlockMetadata(par2, par3, par4) & 3;
Object object = null;
int i1 = 0;
int j1 = 0;
boolean flag = false;
object = new ForestTree();
par1World.setBlock(par2, par3, par4, 0, 0, 4);
if (!((WorldGenerator)object).generate(par1World, par5Random, par2 + i1, par3, par4 + j1))
{
par1World.setBlock(par2, par3, par4, this.blockID, l, 4);
}
}
示例7: ChunkProviderMultiBiome
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderMultiBiome(World world, long seed, boolean mapFeaturesEnabled) {
this.worldObj = world;
this.mapFeaturesEnabled = mapFeaturesEnabled;
this.rand = new Random(seed);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise };
noiseGens = TerrainGen.getModdedNoiseGenerators(world, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
}
示例8: generateTree
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
@Override
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
if (!TerrainGen.saplingGrowTree(worldIn, rand, pos)) return;
WorldGenerator worldgenerator;// = (WorldGenerator)(rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true));
int i = 0;
int j = 0;
boolean flag = false;
worldgenerator = new CPCherryTreeGen(4, false);
IBlockState iblockstate2 = Blocks.AIR.getDefaultState();
worldIn.setBlockState(pos, iblockstate2, 4);
if (!worldgenerator.generate(worldIn, rand, pos.add(i, 0, j)))
{
worldIn.setBlockState(pos, state, 4);
}
}
示例9: ChunkProviderCustomHell
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderCustomHell(World par1World, long par2)
{
this.worldObj = par1World;
this.hellRNG = new Random(par2);
this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16);
this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16);
this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8);
this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4);
this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10);
this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16);
NoiseGenerator[] noiseGens = {netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7};
noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.hellRNG, noiseGens);
this.netherNoiseGen1 = (NoiseGeneratorOctaves)noiseGens[0];
this.netherNoiseGen2 = (NoiseGeneratorOctaves)noiseGens[1];
this.netherNoiseGen3 = (NoiseGeneratorOctaves)noiseGens[2];
this.slowsandGravelNoiseGen = (NoiseGeneratorOctaves)noiseGens[3];
this.netherrackExculsivityNoiseGen = (NoiseGeneratorOctaves)noiseGens[4];
this.netherNoiseGen6 = (NoiseGeneratorOctaves)noiseGens[5];
this.netherNoiseGen7 = (NoiseGeneratorOctaves)noiseGens[6];
}
示例10: IceSectorChunkProvider
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public IceSectorChunkProvider(World world, long worldSeed)
{
this.world = world;
this.random = new Random(worldSeed);
this.noiseGen1 = new NoiseGeneratorOctaves(this.random, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.random, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.random, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.random, 10);
this.noiseGen5 = new NoiseGeneratorOctaves(this.random, 16);
NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5};
noiseGens = TerrainGen.getModdedNoiseGenerators(world, this.random, noiseGens);
this.noiseGen1 = (NoiseGeneratorOctaves) noiseGens[0];
this.noiseGen2 = (NoiseGeneratorOctaves) noiseGens[1];
this.noiseGen3 = (NoiseGeneratorOctaves) noiseGens[2];
this.noiseGen4 = (NoiseGeneratorOctaves) noiseGens[3];
this.noiseGen5 = (NoiseGeneratorOctaves) noiseGens[4];
}
示例11: decorate
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public void decorate(World world, Random random, int chunkX, int chunkZ, AgeBiome biome) {
int x, y, z;
WorldGenerator gen;
for(int i = 0; i < grassPerChunk; i++) {
x = chunkX + random.nextInt(16) + 8;
y = random.nextInt(128);
z = chunkZ + random.nextInt(16) + 8;
gen = biome.getRandomWorldGenForGrass(random);
gen.generate(world, random, x, y, z);
}
for(int i = 0; i < smallTreesPerChunk; i++) {
x = chunkX + random.nextInt(16) + 8;
z = chunkZ + random.nextInt(16) + 8;
y = EQUtil.getFirstUncoveredBlock(world, x, z);
tempSmallTreeGen.generate(world, random, x, y, z);
}
for(int i = 0; i < oreGens.length; i++) {
if(oreGens[i] != null) {
if(TerrainGen.generateOre(world, random, oreGens[i], chunkX, chunkZ, GenerateMinable.EventType.CUSTOM)) {
genStandardOre(world, random, chunkX, chunkZ, oreGens[i], oreGens[i].oreGenPerChunk, oreGens[i].oreGenMinY, oreGens[i].oreGenMaxY);
}
}
}
}
示例12: ChunkProviderEI
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderEI(World world, long seed, boolean mapFeaturesEnabled) {
this.worldObj = world;
this.mapFeaturesEnabled = mapFeaturesEnabled;
this.rand = new Random(seed);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise };
noiseGens = TerrainGen.getModdedNoiseGenerators(world, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
}
示例13: ChunkProviderEI
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public ChunkProviderEI(World world, long seed, boolean mapFeaturesEnabled) {
this.worldObj = world;
this.mapFeaturesEnabled = mapFeaturesEnabled;
this.rand = new Random(seed);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = { noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise };
noiseGens = (NoiseGeneratorOctaves[]) TerrainGen.getModdedNoiseGenerators(world, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
}
示例14: AquatanChunkProvider
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public AquatanChunkProvider(World par1World, long par2, boolean par4)
{
this.worldObj = par1World;
this.mapFeaturesEnabled = par4;
this.rand = new Random(par2);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
}
示例15: MoltarChunkProvider
import net.minecraftforge.event.terraingen.TerrainGen; //導入依賴的package包/類
public MoltarChunkProvider(World par1World, long par2, boolean par4, BaseWorldType type)
{
this.worldObj = par1World;
this.mapFeaturesEnabled = par4;
this.rand = new Random(par2);
this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);
this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8);
NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5, noiseGen6, mobSpawnerNoise};
noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);
this.noiseGen1 = noiseGens[0];
this.noiseGen2 = noiseGens[1];
this.noiseGen3 = noiseGens[2];
this.noiseGen4 = noiseGens[3];
this.noiseGen5 = noiseGens[4];
this.noiseGen6 = noiseGens[5];
this.mobSpawnerNoise = noiseGens[6];
this.worldType = type;
}