本文整理匯總了Java中net.minecraft.world.gen.IChunkGenerator類的典型用法代碼示例。如果您正苦於以下問題:Java IChunkGenerator類的具體用法?Java IChunkGenerator怎麽用?Java IChunkGenerator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IChunkGenerator類屬於net.minecraft.world.gen包,在下文中一共展示了IChunkGenerator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
int blockX = chunkX * 16;
int blockZ = chunkZ * 16;
switch (world.provider.getDimension())
{
case -1:
generateNether(world, rand, blockX + 8, blockZ + 8);
break;
case 0:
generateOverworld(world, rand, blockX + 8, blockZ + 8);
break;
case 1:
generateEnd(world, rand, blockX + 8, blockZ + 8);
break;
}
}
示例2: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (!(chunkGenerator instanceof ChunkGeneratorFlat)) { //don't generate on flatworlds
switch (world.provider.getDimension()) {
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
break;
case -1:
generateNether(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
default:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
}
}
}
示例3: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
int dim = world.provider.getDimension();
if(dim == 0)
{
if(chunkX == 44 && chunkZ == 44)
HarshenStructures.CASTLE.generateStucture(world, random, chunkX, chunkZ);
runGenerator(this.soulore, world, random, chunkX, chunkZ, 10, 0.5f, 0, 20);
flowerGenerator(HarshenBlocks.HARSHEN_SOUL_FLOWER, world, random, chunkX, chunkZ, 0.015f);
flowerGenerator(HarshenBlocks.PLANT_OF_GLEAM, world, random, chunkX, chunkZ, 0.015f);
}
else if(dim == DimensionPontus.DIMENSION_ID)
{
runGenerator(this.itiumOre, world, random, chunkX, chunkZ, 15, 0.7f, 0, 255);
runGenerator(this.pontusEmeraldOre, world, random, chunkX, chunkZ, 25, 0.3f, 0, 255);
}
runGenerator(jewelDirt, world, random, chunkX, chunkZ, 40, 100.0f, 0, 200);
generateStructure(world, HarshenStructure.get(dim), random, chunkX, chunkZ);
}
示例4: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
if (random.nextInt(20) == 0){
int x = chunkX * 16 + 2 + random.nextInt(12);
int z = chunkZ * 16 + 2 + random.nextInt(12);
BlockPos p = new BlockPos(x,0,z);
p = world.getHeight(p);
Biome b = world.getBiome(p);
if (BiomeDictionary.hasType(b, BiomeDictionary.Type.FOREST) || b == Biomes.FOREST || b == Biomes.FOREST_HILLS){
if (world.getBlockState(p.down()).getBlock() instanceof BlockGrass && world.isAirBlock(p)){
BlockTeaSapling.generateTree(world, p, Blocks.AIR.getDefaultState(), random);
}
}
}
}
示例5: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
StabilityHandler.addChunkData(world.provider.getDimension(), new ChunkPos(chunkX, chunkZ), StabilityHandler.generateChunkStability(random));
if (world.provider.getDimensionType() == DimensionType.OVERWORLD) {
WorldGenMinable lodestone = new WorldGenMinable(RegistryManager.lodestone_ore.getDefaultState(), Config.LODESTONE_VEIN_SIZE);
for (int i = 0; i < Config.LODESTONE_FREQUENCY; i++) {
int x = chunkX * 16 + random.nextInt(16);
int y = random.nextInt(Config.LODESTONE_MAX_Y - Config.LODESTONE_MIN_Y) + Config.LODESTONE_MIN_Y;
int z = chunkZ * 16 + random.nextInt(16);
lodestone.generate(world, random, new BlockPos(x, y, z));
}
BlockPos pos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
WorldGenRift rift = new WorldGenRift();
rift.generate(world, random, pos);
}
}
示例6: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate (Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
int x = chunkX * 16 + 8;
int z = chunkZ * 16 + 8;
Biome biome = world.getBiome(new BlockPos(x, 0, z));
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD ))
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.WET)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.WASTELAND)
|| BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY))
return;
if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY))
return;
if (random.nextInt(15) > 0)
return;
generate(world, random, new BlockPos(x, world.getSeaLevel(), z));
}
示例7: gen
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
void gen(World world, int x, int z, IChunkGenerator generator, IChunkProvider provider) {
random.setSeed(world.getSeed());
long good = random.nextLong();
long succ = random.nextLong();
good *= x >> 1;
succ *= z >> 1;
random.setSeed(good ^ succ ^ world.getSeed());
//Generate
if(GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity > 0D && GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity / 100D > random.nextDouble()) {
BlockPos center = new BlockPos(x, 15 + random.nextInt(25), z);
if(!world.canSeeSky(center) || !GEN_CONFIG.ASHEN_CUBE_STRUCTURE.underground) {
genCubes(world, center);
}
}
}
示例8: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.getDimension())
{
case -1:
break;
case 0:
genSurface(world, random, chunkX, chunkZ, chunkGenerator, chunkProvider);
break;
case 1:
break;
}
}
示例9: generateOverworld
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
private void generateOverworld(Random random, int chunkX, int chunkY, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
for(WorldGeneratorOreInstance inst : WorldGenStaticVars.worldGenInstances ) {
generateOre(
inst.targetBlock.getDefaultState(),
world,
random,
chunkX*16,
chunkY*16,
inst.minHeight,
inst.maxHeight,
random.nextInt(inst.size),
inst.spawnAttempts
);
}
//generateOre(Smeltables.blockOreCopper.getDefaultState(), world, random, chunkX * 16, chunkY * 16, 16, 64, 4 + random.nextInt(4), 100);
}
示例10: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (random.nextInt(ToroQuestConfiguration.structureSpawnChance) != 0 || world.provider.getDimension() != 0) {
return;
}
int roll = random.nextInt(5);
switch (roll) {
case 0:
genMonolith(world, random, chunkX, chunkZ);
break;
case 1:
genBastionsLair(world, random, chunkX, chunkZ);
break;
case 2:
genMageTower(world, random, chunkX, chunkZ);
break;
case 3:
genThroneRoom(world, random, chunkX, chunkZ);
break;
case 4:
genGraveyard(world, random, chunkX, chunkZ);
break;
}
}
示例11: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
// public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.getDimension()) {// was get dim id
case 0: // Overworld
this.runGenerator(this.gen_machineMod_CrudeOilStone, world, random, chunkX, chunkZ, 15, Reference.crudeOilStoneGenMinlevel, Reference.crudeOilStoneGenMaxlevel);
break;
case -1: // Nether
break;
case 1: // End
break;
}
}
示例12: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.getDimension() == Const.Dimension.end) {
if (this.genGold != null && Configs.spawnChanceGold > 0)
this.run(this.genGold, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceGold, MIN_HEIGHT, MAX_HEIGHT);
if (this.genRedstone != null && Configs.spawnChanceRedstone > 0)
this.run(this.genRedstone, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceRedstone, MIN_HEIGHT, MAX_HEIGHT);
if (this.genCoal != null && Configs.spawnChanceCoal > 0)
this.run(this.genCoal, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceCoal, MIN_HEIGHT, MAX_HEIGHT);
if (this.genEmerald != null && Configs.spawnChanceEmerald > 0)
this.run(this.genEmerald, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceEmerald, MIN_HEIGHT, MAX_HEIGHT);
if (this.genLapis != null && Configs.spawnChanceLapis > 0)
this.run(this.genLapis, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceLapis, MIN_HEIGHT, MAX_HEIGHT);
if (this.genDiamond != null && Configs.spawnChanceDiamond > 0)
this.run(this.genDiamond, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceDiamond, MIN_HEIGHT, MAX_HEIGHT);
if (this.genIron != null && Configs.spawnChanceIron > 0)
this.run(this.genIron, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceIron, MIN_HEIGHT, MAX_HEIGHT);
}
}
示例13: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.getDimension() == Const.Dimension.nether) {
if (this.genRedstone != null && Configs.spawnChanceRedstone > 0)
this.run(this.genRedstone, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceRedstone, MIN_HEIGHT, MAX_HEIGHT);
if (this.genGold != null && Configs.spawnChanceGold > 0)
this.run(this.genGold, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceGold, MIN_HEIGHT, MAX_HEIGHT);
if (this.genCoal != null && Configs.spawnChanceCoal > 0)
this.run(this.genCoal, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceCoal, MIN_HEIGHT, MAX_HEIGHT);
if (this.genEmerald != null && Configs.spawnChanceEmerald > 0)
this.run(this.genEmerald, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceEmerald, MIN_HEIGHT, MAX_HEIGHT);
if (this.genLapis != null && Configs.spawnChanceLapis > 0)
this.run(this.genLapis, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceLapis, MIN_HEIGHT, MAX_HEIGHT);
if (this.genDiamond != null && Configs.spawnChanceDiamond > 0)
this.run(this.genDiamond, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceDiamond, MIN_HEIGHT, MAX_HEIGHT);
if (this.genIron != null && Configs.spawnChanceIron > 0)
this.run(this.genIron, world, random, chunkX * Const.CHUNK_SIZE, chunkZ * Const.CHUNK_SIZE, Configs.spawnChanceIron, MIN_HEIGHT, MAX_HEIGHT);
}
}
示例14: generate
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
if(world.provider.isSurfaceWorld())
{
if(ConfigValues.SPAWN_COPPER)
spawnOres(ModBlocks.oreCopper, world, random, chunkX, chunkZ, 16, 16, 4 + random.nextInt(5), 10, 35, 128);
if(ConfigValues.SPAWN_ZINC)
spawnOres(ModBlocks.oreZinc, world, random, chunkX, chunkZ, 16, 16, 4 + random.nextInt(5), 10, 20, 128);
if(ConfigValues.SPAWN_ALUMINUM)
spawnOres(ModBlocks.oreAluminum, world, random, chunkX, chunkZ, 16, 16, 4 + random.nextInt(5), 16, 50, 128);
if(ConfigValues.SPAWN_MOON_FLOWER_RELIC)
spawnOres(ModBlocks.relicMoonFlower, world, random, chunkX, chunkZ, 16, 16, 1 + random.nextInt(20), 1, 1, 20);
if(ConfigValues.SPAWN_UNKNOWN_RELIC)
spawnOres(ModBlocks.relicUnknown, world, random, chunkX, chunkZ, 16, 16, 1 + random.nextInt(4), 4, 1, 20);
}
}
示例15: getNewChunkProvider
import net.minecraft.world.gen.IChunkGenerator; //導入依賴的package包/類
private IChunkGenerator getNewChunkProvider(World world, String chunkProviderType, String generatorOptions)
{
if (chunkProviderType.equals("VANILLA_DEFAULT"))
{
return new ChunkGeneratorOverworld(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions);
}
else if (chunkProviderType.equals("VANILLA_FLAT"))
{
return new ChunkGeneratorFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions);
}
else if (chunkProviderType.equals("VANILLA_HELL"))
{
return new ChunkGeneratorHell(world, world.getWorldInfo().isMapFeaturesEnabled(), world.getSeed());
}
else if (chunkProviderType.equals("VANILLA_END"))
{
return new ChunkGeneratorEnd(world, world.getWorldInfo().isMapFeaturesEnabled(), world.getSeed(), new BlockPos(100, 50, 0));
}
return null;
}