Java 类net.minecraft.world.gen.feature.WorldGenMinable 实例源码
项目:Etheric
文件:EthericWorldGenerator.java
@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);
}
}
项目:Backmemed
文件:BiomeDecorator.java
public void decorate(World worldIn, Random random, Biome biome, BlockPos pos)
{
if (this.decorating)
{
throw new RuntimeException("Already decorating");
}
else
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(worldIn.getWorldInfo().getGeneratorOptions()).build();
this.chunkPos = pos;
this.dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), this.chunkProviderSettings.dirtSize);
this.gravelGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), this.chunkProviderSettings.gravelSize);
this.graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize);
this.dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize);
this.andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize);
this.coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), this.chunkProviderSettings.coalSize);
this.ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), this.chunkProviderSettings.ironSize);
this.goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), this.chunkProviderSettings.goldSize);
this.redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), this.chunkProviderSettings.redstoneSize);
this.diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), this.chunkProviderSettings.diamondSize);
this.lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), this.chunkProviderSettings.lapisSize);
this.genDecorations(biome, worldIn, random);
this.decorating = false;
}
}
项目:CustomWorldGen
文件:BiomeDecorator.java
public void decorate(World worldIn, Random random, Biome biome, BlockPos pos)
{
if (this.decorating)
{
throw new RuntimeException("Already decorating");
}
else
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(worldIn.getWorldInfo().getGeneratorOptions()).build();
this.chunkPos = pos;
this.dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), this.chunkProviderSettings.dirtSize);
this.gravelGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), this.chunkProviderSettings.gravelSize);
this.graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize);
this.dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize);
this.andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize);
this.coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), this.chunkProviderSettings.coalSize);
this.ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), this.chunkProviderSettings.ironSize);
this.goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), this.chunkProviderSettings.goldSize);
this.redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), this.chunkProviderSettings.redstoneSize);
this.diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), this.chunkProviderSettings.diamondSize);
this.lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), this.chunkProviderSettings.lapisSize);
this.genDecorations(biome, worldIn, random);
this.decorating = false;
}
}
项目:MineMania-Rebirth-1.7.10
文件:UOreGeneration.java
public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize,
int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block, vienSize, generateIn);
for (int i = 0; i < chance; i++) {
int xRand = chunkX * random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkZ * random.nextInt(16);
gen.generate(world, random, xRand, yRand, zRand);
}
}
项目:OpenModLoader
文件:GameRegistry.java
/**
* Registers an ore generator to the world generator registry.
*
* @param id the generator ID. Must be unique.
* @param ore the ore
* @param replaceables the blocks the ore may spawn in, usually stone for
* the overworld and netherrack for the nether
* @param veinSize the vein size
* @param minY the minimum Y level the ore may spawn at
* @param maxY the maximum Y level the ore may spawn at
* @param dimensions the dimensions the ore may spawn in. May be
* {@link Short#MAX_VALUE} as a wildcard.
* @param attempts the number of attempts at spawning the ore per chunk
*/
public static void registerOreGen(ResourceLocation id, IBlockState ore, IBlockState[] replaceables, int veinSize, int minY, int maxY, int[] dimensions, int attempts) {
List<IBlockState> replaceableList = Arrays.asList(replaceables);
WorldGenMinable generator = new WorldGenMinable(ore, veinSize, replaceableList::contains);
registerWorldGen(id, (biome, world, random, chunkPos) -> {
for (int dimension : dimensions) {
if (dimension != world.provider.getDimensionType().getId() && dimension != Short.MAX_VALUE) {
continue;
}
for (int attempt = 0; attempt < attempts; attempt++) {
int xOffset = world.rand.nextInt(16);
int yOffset = world.rand.nextInt(maxY - minY + 1) + minY;
int zOffset = world.rand.nextInt(16);
BlockPos pos = chunkPos.add(xOffset, yOffset, zOffset);
generator.generate(world, world.rand, pos);
}
return;
}
});
}
项目:ARKCraft
文件:WrappedOreGenerator.java
private void generateInOverworld(Instruction par1, World world, Random random, int x, int z)
{
for (int k = 0; k < par1.getVeinsPerChunk(); k++)
{
int chunkX = x + random.nextInt(16);
int chunkY = random.nextInt(par1.getMaxHeight());
int chunkZ = z + random.nextInt(16);
// TODO Implement the below if() statement
// if(world.getBlockState(instruction.getBlockType() ==
// GlobalAdditions.surfaceCrystals)) {
if (!isValidSpawn(world, chunkX, chunkY, chunkZ)) { return; }
// }
new WorldGenMinable(par1.getBlockType().getDefaultState(), par1.getBlocksPerVein()).generate(world, random,
new BlockPos(chunkX, chunkY, chunkZ));
}
}
项目:NordMod
文件:NordOre.java
private void generateAllOverworldOre(World world, Random rand, int chunkX, int chunkZ){
for(int i=0;i< listOre.size();i++){
if(listOre.get(i).dimId==0){
for (int k = 0; k < listOre.get(i).frequencyOre; k++)
{
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
int quisqueY=-1;
while (listOre.get(i).minY>quisqueY||listOre.get(i).maxY<quisqueY){
quisqueY=rand.nextInt(listOre.get(i).minY+listOre.get(i).maxY);
}
BlockPos quisquePos = new BlockPos(firstBlockXCoord, quisqueY, firstBlockZCoord);
//The listOre[i].veinSize as the second parameter sets the maximum vein size
(new WorldGenMinable(listOre.get(i).block,listOre.get(i).veinSize)).generate(world, rand, quisquePos);
}
}
}
}
项目:NordMod
文件:NordOre.java
private void generateAllNetherOre(World world, Random rand, int chunkX, int chunkZ){
for(int i=0;i< listOre.size();i++){
if(listOre.get(i).dimId==-1){
for (int k = 0; k < listOre.get(i).frequencyOre; k++)
{
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
int quisqueY=-1;
while (listOre.get(i).minY>quisqueY||listOre.get(i).maxY<quisqueY){
quisqueY=rand.nextInt(listOre.get(i).minY+listOre.get(i).maxY);
}
BlockPos quisquePos = new BlockPos(firstBlockXCoord, quisqueY, firstBlockZCoord);
//The listOre[i].veinSize as the second parameter sets the maximum vein size
(new WorldGenMinable(listOre.get(i).block,listOre.get(i).veinSize)).generate(world, rand, quisquePos);
}
}
}
}
项目:NordMod
文件:NordOre.java
private void generateAllEndOre(World world, Random rand, int chunkX, int chunkZ){
for(int i=0;i< listOre.size();i++){
if(listOre.get(i).dimId==1){
for (int k = 0; k < listOre.get(i).frequencyOre; k++)
{
int firstBlockXCoord = chunkX + rand.nextInt(16);
int firstBlockZCoord = chunkZ + rand.nextInt(16);
int quisqueY=-1;
while (listOre.get(i).minY>quisqueY||listOre.get(i).maxY<quisqueY){
quisqueY=rand.nextInt(listOre.get(i).minY+listOre.get(i).maxY);
}
BlockPos quisquePos = new BlockPos(firstBlockXCoord, quisqueY, firstBlockZCoord);
//The listOre[i].veinSize as the second parameter sets the maximum vein size
(new WorldGenMinable(listOre.get(i).block,listOre.get(i).veinSize)).generate(world, rand, quisquePos);
}
}
}
}
项目:Cyclic
文件:WorldGenEndOre.java
public WorldGenEndOre() {
if (Configs.blockCountGold > 0)
this.genGold = new WorldGenMinable(WorldModule.end_gold_ore.getDefaultState(), Configs.blockCountGold, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountIron > 0)
this.genIron = new WorldGenMinable(WorldModule.end_iron_ore.getDefaultState(), Configs.blockCountIron, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountRedstone > 0)
this.genRedstone = new WorldGenMinable(WorldModule.end_redstone_ore.getDefaultState(), Configs.blockCountRedstone, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountCoal > 0)
this.genCoal = new WorldGenMinable(WorldModule.end_coal_ore.getDefaultState(), Configs.blockCountCoal, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountEmerald > 0)
this.genEmerald = new WorldGenMinable(WorldModule.end_emerald_ore.getDefaultState(), Configs.blockCountEmerald, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountLapis > 0)
this.genLapis = new WorldGenMinable(WorldModule.end_lapis_ore.getDefaultState(), Configs.blockCountLapis, BlockMatcher.forBlock(Blocks.END_STONE));
if (Configs.blockCountDiamond > 0)
this.genDiamond = new WorldGenMinable(WorldModule.end_diamond_ore.getDefaultState(), Configs.blockCountDiamond, BlockMatcher.forBlock(Blocks.END_STONE));
}
项目:Cyclic
文件:WorldGenNetherOre.java
public WorldGenNetherOre() {
if (Configs.blockCountRedstone > 0)
this.genRedstone = new WorldGenMinable(WorldModule.nether_redstone_ore.getDefaultState(), Configs.blockCountRedstone, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountIron > 0)
this.genIron = new WorldGenMinable(WorldModule.nether_iron_ore.getDefaultState(), Configs.blockCountIron, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountGold > 0)
this.genGold = new WorldGenMinable(WorldModule.nether_gold_ore.getDefaultState(), Configs.blockCountGold, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountCoal > 0)
this.genCoal = new WorldGenMinable(WorldModule.nether_coal_ore.getDefaultState(), Configs.blockCountCoal, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountEmerald > 0)
this.genEmerald = new WorldGenMinable(WorldModule.nether_emerald_ore.getDefaultState(), Configs.blockCountEmerald, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountLapis > 0)
this.genLapis = new WorldGenMinable(WorldModule.nether_lapis_ore.getDefaultState(), Configs.blockCountLapis, BlockMatcher.forBlock(Blocks.NETHERRACK));
if (Configs.blockCountDiamond > 0)
this.genDiamond = new WorldGenMinable(WorldModule.nether_diamond_ore.getDefaultState(), Configs.blockCountDiamond, BlockMatcher.forBlock(Blocks.NETHERRACK));
}
项目:Minestrappolation-4
文件:MGenHandler.java
private void generateOre(Block block, World world, Random rand, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Predicate blockType, boolean generate)
{
if (generate == true)
{
int vienSize = minVienSize + rand.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize, blockType);
for (int i = 0; i < chance; i++)
{
int xRand = chunkX * 16 + rand.nextInt(16);
int yRand = rand.nextInt(heightRange) + minY;
int zRand = chunkZ * 16 + rand.nextInt(16);
BlockPos position = new BlockPos(xRand, yRand, zRand);
gen.generate(world, rand, position);
}
}
}
项目:Aftermath
文件:OreGenHandler.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
if(!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd))
{
for(int i = 0; i < ConfigurationHandler.leadOrePerChunk; i++)
{
int randPosX = (chunkX*16) + random.nextInt(16);
int randPosY = random.nextInt(60);
int randPosZ = (chunkZ*16) + random.nextInt(16);
new WorldGenMinable(ModBlocks.leadOre, 10, Blocks.stone).generate(world, random, randPosX, randPosY, randPosZ);
}
}
}
项目:ARKCraft-Code
文件:WrappedOreGenerator.java
private void generateInOverworld(Instruction par1, World world, Random random, int x, int z)
{
for (int k = 0; k < par1.getVeinsPerChunk(); k++)
{
int chunkX = x + random.nextInt(16);
int chunkY = random.nextInt(par1.getMaxHeight());
int chunkZ = z + random.nextInt(16);
//TODO Implement the below if() statement
//if(world.getBlockState(instruction.getBlockType() == GlobalAdditions.surfaceCrystals)) {
if (!isValidSpawn(world, chunkX, chunkY, chunkZ))
{
return;
}
//}
new WorldGenMinable(par1.getBlockType().getDefaultState(), par1.getBlocksPerVein()).generate(world, random, new BlockPos(chunkX, chunkY, chunkZ));
}
}
项目:Minegate
文件:NaquadahOreGenerator.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
chunkX *= 16;
chunkZ *= 16;
//System.out.println("All the cool kids do world gen");
if(world.provider.dimensionId == 0)
{
//for(int k = 0; k < 1; k++) {
int chance = 2;
if(MineGate.doesClassExist("moze_intel.projecte.api.ProjectEAPI"))
chance = 16;
if(random.nextInt(chance) == 0)
{
int firstBlockXCoord = chunkX + random.nextInt(16);
int firstBlockYCoord = random.nextInt(10);
int firstBlockZCoord = chunkZ + random.nextInt(16);
new WorldGenMinable(MineGate.naquadahOre, 3).generate(world, random, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
//System.out.println("Doing stuff at " + firstBlockXCoord + ", " + firstBlockYCoord + ", " + firstBlockZCoord);
//}
}
}
}
项目:Minegate
文件:NaquadahOreGenerator.java
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
chunkX *= 16;
chunkZ *= 16;
if(world.provider.dimensionId == 0)
{
int chance = 2;
if(MineGate.doesClassExist("moze_intel.projecte.api.ProjectEAPI"))
chance = 16;
if(random.nextInt(chance) == 0)
{
int firstBlockXCoord = chunkX + random.nextInt(16);
int firstBlockYCoord = random.nextInt(10);
int firstBlockZCoord = chunkZ + random.nextInt(16);
new WorldGenMinable(MineGate.naquadahOre, 3).generate(world, random, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord);
//System.out.println("Doing stuff at " + firstBlockXCoord + ", " + firstBlockYCoord + ", " + firstBlockZCoord);
//}
}
}
}
项目:Resilience-Client-Source
文件:BiomeDecorator.java
public BiomeDecorator()
{
this.sandGen = new WorldGenSand(Blocks.sand, 7);
this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
this.dirtGen = new WorldGenMinable(Blocks.dirt, 32);
this.gravelGen = new WorldGenMinable(Blocks.gravel, 32);
this.coalGen = new WorldGenMinable(Blocks.coal_ore, 16);
this.ironGen = new WorldGenMinable(Blocks.iron_ore, 8);
this.goldGen = new WorldGenMinable(Blocks.gold_ore, 8);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6);
this.field_150514_p = new WorldGenFlowers(Blocks.yellow_flower);
this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
this.bigMushroomGen = new WorldGenBigMushroom();
this.reedGen = new WorldGenReed();
this.cactusGen = new WorldGenCactus();
this.waterlilyGen = new WorldGenWaterlily();
this.flowersPerChunk = 2;
this.grassPerChunk = 1;
this.sandPerChunk = 1;
this.sandPerChunk2 = 3;
this.clayPerChunk = 1;
this.generateLakes = true;
}
项目:Resilience-Client-Source
文件:BiomeGenHills.java
protected BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
项目:CarbonMod
文件:OreGen.java
private void generateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 10; k++)
{
int OreXCoord1 = i + random.nextInt(16);
int OreYCoord1 = random.nextInt(64);
int OreZCoord1 = j + random.nextInt(16);
int OreXCoord2 = i + random.nextInt(16);
int OreYCoord2 = random.nextInt(64);
int OreZCoord2 = j + random.nextInt(16);
int OreXCoord3 = i + random.nextInt(16);
int OreYCoord3 = random.nextInt(64);
int OreZCoord3 = j + random.nextInt(16);
if(world.provider != null)
{
(new WorldGenMinable(ModBlocks.energizedOre, Reference.energizedAmount)).generate(world, random, OreXCoord1, OreYCoord1, OreZCoord1);
(new WorldGenMinable(ModBlocks.rawcarbonOre, Reference.rawCarbonAmount)).generate(world, random, OreXCoord2, OreYCoord2, OreZCoord2);
(new WorldGenMinable(ModBlocks.rawBluchoriditeOre, Reference.rawBluchoriditeAmount)).generate(world, random, OreXCoord3, OreYCoord3, OreZCoord3);
}
}
}
项目:taam
文件:OreGenerator.java
public void reloadGenerationInfo() {
Log.info("Reloading Ore Gen info");
gens = new ArrayList<GenerationInfo>();
Predicate<IBlockState> stone = new Predicate<IBlockState>() {
@Override
public boolean apply(IBlockState input){
return input != null && input.getBlock() == Blocks.STONE;
}
};
Taam.BLOCK_ORE_META[] oreMeta = Taam.BLOCK_ORE_META.values();
for(int i = 0; i < Config.NUM_ORES; i++) {
if(Config.genOre[i]) {
Log.info("Enabling {} generation", oreMeta[i].config_name);
gens.add(new GenerationInfo(oreMeta[i],
new WorldGenMinable(BLOCK_ORE_META.getOre(oreMeta[i]), Config.oreSize[i], stone),
Config.oreAbove[i], Config.oreBelow[i], Config.oreDepositCount[i]));
} else {
Log.info("Disabling {} generation", oreMeta[i].config_name);
}
}
}
项目:MineFantasy
文件:WorldGenMF.java
private void addOreWithNeighbour(Random rand, int chunkX, int chunkZ, World world, int id, int meta, int size, int abundance, int min, int max, int inside, int neighbour)
{
for(int a = 0; a < abundance; a ++)
{
int x = chunkX*16 + rand.nextInt(16);
int y = min + rand.nextInt(max-min+1);
int z = chunkZ*16 + rand.nextInt(16);
if(isNeibourNear(world, x, y, z, neighbour))
{
if(neighbour == Block.lavaStill.blockID)
{
System.out.println("Gen By Lava: " + x + " " + y + " " + z);
}
(new WorldGenMinable(id, meta, size, inside)).generate(world, rand, x, y, z);
}
}
}
项目:Runecraft-2
文件:OreWorldGeneratorRunecraft2.java
public OreWorldGeneratorRunecraft2(){
this.gen_adamantite_ore = new WorldGenMinable(Blocks.AdamantiteOre.getDefaultState(), 4);
this.gen_mithril_ore = new WorldGenMinable(Blocks.MithrilOre.getDefaultState(), 4);
this.gen_runite_ore = new WorldGenMinable(Blocks.RuniteOre.getDefaultState(), 4);
this.gen_iron_ore = new WorldGenMinable(Blocks.IronOre.getDefaultState(), 8);
this.gen_copper_ore = new WorldGenMinable(Blocks.CopperOre.getDefaultState(), 8);
this.gen_tin_ore = new WorldGenMinable(Blocks.TinOre.getDefaultState(), 8);
this.gen_gold_ore = new WorldGenMinable(Blocks.GoldOre.getDefaultState(), 4);
this.gen_silver_ore = new WorldGenMinable(Blocks.SilverOre.getDefaultState(), 4);
this.gen_coal_ore = new WorldGenMinable(Blocks.CoalOre.getDefaultState(), 10);
this.gen_runeessence_ore = new WorldGenMinable(Blocks.RuneEssenceOre.getDefaultState(), 8);
this.gen_pureessence_ore = new WorldGenMinable(Blocks.PureEssenceOre.getDefaultState(), 4);
}
项目:ZeroQuest
文件:BiomeGenNileMountains.java
public BiomeGenNileMountains(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
this.spawnableMonsterList.clear();
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
项目:ZeroQuest
文件:BiomeGenNileMountains.java
public BiomeGenNileMountains(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), 9);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
项目:Metallurgy4
文件:WorldGenMetals.java
public WorldGenMetals(Block block, int metaId, int[] generationInfo, String dimensionsInfo)
{
this.genBlock = block;
this.genMetaId = metaId;
this.generation = generationInfo;
this.dimensions = dimensionsInfo;
Block targetId = Blocks.stone;
if (this.vaildDimension(-1))
{
targetId = Blocks.netherrack;
}
if (this.vaildDimension(1))
{
targetId = Blocks.end_stone;
}
this.blockSeed = this.genBlockSeed(block, metaId);
this.mineable = new WorldGenMinable(block, metaId, this.generation[1], targetId);
WorldGenMetals.generators.add(this);
}
项目:AbyssalCraft
文件:BiomeGenDarklandsMountains.java
@Override
public void decorate(World par1World, Random par2Random, BlockPos pos)
{
super.decorate(par1World, par2Random, pos);
int var5 = 3 + par2Random.nextInt(6);
if(ACConfig.generateAbyssalniteOre)
for (int rarity = 0; rarity < var5; ++rarity)
{
int veinSize = 1 + par2Random.nextInt(3);
int x = par2Random.nextInt(16);
int y = par2Random.nextInt(28) + 4;
int z = par2Random.nextInt(16);
new WorldGenMinable(ACBlocks.abyssalnite_ore.getDefaultState(), veinSize).generate(par1World, par2Random, pos.add(x, y, z));
}
}
项目:mcplus_mods
文件:WorldGens.java
public static void SPAWN_ORE(IBlockState parBlock, World parWorld, Random parRandom, int parBlockX, int parBlockZ, int parMinVeinSize, int parMaxVeinSize, int parSpawnFrequency, int parMinY, int parMaxY )
{
assert(parMaxVeinSize >= parMinVeinSize);
assert(parMaxY >= parMinY);
if (parMinVeinSize == parMaxVeinSize) parMinVeinSize = parMaxVeinSize - 1;
if (parMinY == parMaxY) parMaxY = parMinY - 1;
for(int i = 0; i < parSpawnFrequency; i++)
{
BlockPos pos = new BlockPos(
parBlockX + parRandom.nextInt(16),
parMinY + parRandom.nextInt(parMaxY - parMinY),
parBlockZ + parRandom.nextInt(16)
);
new WorldGenMinable(parBlock, (parMinVeinSize + parRandom.nextInt(parMaxVeinSize - parMinVeinSize))).generate(parWorld, parRandom, pos);
}
}
项目:Cauldron
文件:BiomeDecorator.java
public BiomeDecorator()
{
this.sandGen = new WorldGenSand(Blocks.sand, 7);
this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
this.dirtGen = new WorldGenMinable(Blocks.dirt, 32);
this.gravelGen = new WorldGenMinable(Blocks.gravel, 32);
this.coalGen = new WorldGenMinable(Blocks.coal_ore, 16);
this.ironGen = new WorldGenMinable(Blocks.iron_ore, 8);
this.goldGen = new WorldGenMinable(Blocks.gold_ore, 8);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6);
this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower);
this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
this.bigMushroomGen = new WorldGenBigMushroom();
this.reedGen = new WorldGenReed();
this.cactusGen = new WorldGenCactus();
this.waterlilyGen = new WorldGenWaterlily();
this.flowersPerChunk = 2;
this.grassPerChunk = 1;
this.sandPerChunk = 1;
this.sandPerChunk2 = 3;
this.clayPerChunk = 1;
this.generateLakes = true;
}
项目:Cauldron
文件:BiomeGenHills.java
public BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
项目:Cauldron
文件:BiomeDecorator.java
public BiomeDecorator()
{
this.sandGen = new WorldGenSand(Blocks.sand, 7);
this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6);
this.dirtGen = new WorldGenMinable(Blocks.dirt, 32);
this.gravelGen = new WorldGenMinable(Blocks.gravel, 32);
this.coalGen = new WorldGenMinable(Blocks.coal_ore, 16);
this.ironGen = new WorldGenMinable(Blocks.iron_ore, 8);
this.goldGen = new WorldGenMinable(Blocks.gold_ore, 8);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6);
this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower);
this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom);
this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom);
this.bigMushroomGen = new WorldGenBigMushroom();
this.reedGen = new WorldGenReed();
this.cactusGen = new WorldGenCactus();
this.waterlilyGen = new WorldGenWaterlily();
this.flowersPerChunk = 2;
this.grassPerChunk = 1;
this.sandPerChunk = 1;
this.sandPerChunk2 = 3;
this.clayPerChunk = 1;
this.generateLakes = true;
}
项目:Cauldron
文件:BiomeGenHills.java
public BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
项目:Xenorite
文件:Oregen.java
public void generateInOverworld(World world, Random random, int x, int z)
{
for (int i = 0; i < 1; i++) // The number after i (in this case 6) is how many veins spawn per chunk (16*16*16 area)
{
// DO NOT CHANGE
int xcoord = x + random.nextInt(16); // DO NOT CHANGE
int ycoord = random.nextInt(ConfigurationHandler.oreXenoriteSpawnHeight); // Set In The Config file (ore spawn height)
int zcoord = z + random.nextInt(16); // DO NOT CHANGE
// Generates it (the number in the World Gen Minable function (in this case 5) is the max amount of blocks in each vein).
new WorldGenMinable(xyz.techiecrow.init.ModBlockOres.xenoriteOre, ConfigurationHandler.oreXenoriteSpawnsPerVein).generate(world, random, xcoord, ycoord, zcoord);
int x1coord = x + random.nextInt(16);
int y1coord = random.nextInt(ConfigurationHandler.oreCoreoriteSpawnHeight);
int z1coord = z + random.nextInt(16);
new WorldGenMinable(xyz.techiecrow.init.ModBlockOres.coreoriteOre, ConfigurationHandler.oreCoreoriteSpawnsPerVein).generate(world, random, xcoord, ycoord, zcoord);
int x2coord = x + random.nextInt(16);
int y2coord = random.nextInt(ConfigurationHandler.oreFinoriteSpawnHeight);
int z2coord = z + random.nextInt(16);
new WorldGenMinable(xyz.techiecrow.init.ModBlockOres.finoriteOre, ConfigurationHandler.oreFinoriteSpawnsPerVein).generate(world, random, xcoord, ycoord, zcoord);
// System.out.println("Spawned at: " + world + " " + xcoord + " " + ycoord + " " + zcoord);
}
}
项目:Mythical-Mobs
文件:MythicalWorldGen.java
/**
* Adds a ore with one spawn block.
* @param ore The ore which should generate.
* @param spawnBlock The block in which the ore will spawn.
* @param random A instance of random.
* @param world A instance of the current world.
* @param posX The X position in which the ore should generate.
* @param posZ The Z position in which the ore should generate.
* @param minY The minimum Y position the ore can generate.
* @param maxY The maximum Y position the ore can generate.
* @param minVeinSize The minimum vein size.
* @param maxVeinSize The maximum vein size.
* @param spawnChance The chance of the block spawning.
* */
private void addOceanOre(Block ore, Block spawnBlock, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance) {
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(posX ,posZ);
if(biome instanceof BiomeGenOcean){
for (int i = 0; i < spawnChance; i++) {
int defaultChunkSize = 16;
int xPos = posX + random.nextInt(defaultChunkSize);
int yPos = minY + random.nextInt(maxY - minY);
int zPos = posZ + random.nextInt(defaultChunkSize);
new WorldGenMinable(ore,(minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), spawnBlock).generate(world, random, xPos, yPos, zPos);
}
}
}
项目:Loot-Slash-Conquer
文件:LSCWorldGenerator.java
@SuppressWarnings("unused")
private void addOreSpawn(IBlockState block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chanceToSpawn, int minY, int maxY)
{
for (int i = 0; i < chanceToSpawn; i++)
{
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world, random, new BlockPos(posX, posY, posZ));
}
}
项目:JustJunk
文件:ModWorldGeneration.java
private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) {
int deltaY = maxY - minY;
for (int i = 0; i < chances; i++) {
BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));
WorldGenMinable generator = new WorldGenMinable(ore, size);
generator.generate(world, random, pos);
}
}
项目:Bewitchment
文件:WorldGenOre.java
private void generateOre(World world, Random random, int chunkX, int chunkZ) {
final int heightRange = maxHeight - minHeight;
final int randFactor = (maxOreVeinSize - minOreVeinSize) > 0 ? random.nextInt(maxOreVeinSize - minOreVeinSize) : 0;
final int veinSize = minOreVeinSize + randFactor;
final WorldGenMinable generator = new WorldGenMinable(oreToGen, veinSize, predicate);
for (int i = 0; i < genChance; ++i) {
final int xRandom = chunkX * 16 + random.nextInt(16);
final int yRandom = random.nextInt(heightRange) + minHeight;
final int zRandom = chunkZ * 16 + random.nextInt(16);
generator.generate(world, random, new BlockPos(xRandom, yRandom, zRandom));
}
}
项目:Steam-and-Steel
文件:BaseWorldGeneration.java
public BaseWorldGeneration() {
this.generation_copper = new WorldGenMinable(GrandBlocks.blockcopperore, 7);
this.generation_tin = new WorldGenMinable(GrandBlocks.blocktinore, 7);
this.generation_aluminium = new WorldGenMinable(GrandBlocks.blockaluminiumore, 5);
this.generation_lead = new WorldGenMinable(GrandBlocks.blockleadore, 5);
this.generation_nickel = new WorldGenMinable(GrandBlocks.blocknickelore, 4);
this.generation_ruby = new WorldGenMinable(GrandBlocks.blockrubyore, 3);
this.generation_uranium = new WorldGenMinable(GrandBlocks.blockuraniumore, 3);
this.generation_sulfur = new WorldGenMinable(GrandBlocks.blocksulfurore, 32, Blocks.netherrack);
}
项目:DecompiledMinecraft
文件:BiomeDecorator.java
public void decorate(World worldIn, Random random, BiomeGenBase p_180292_3_, BlockPos p_180292_4_)
{
if (this.currentWorld != null)
{
throw new RuntimeException("Already decorating");
}
else
{
this.currentWorld = worldIn;
String s = worldIn.getWorldInfo().getGeneratorOptions();
if (s != null)
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b();
}
else
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b();
}
this.randomGenerator = random;
this.field_180294_c = p_180292_4_;
this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize);
this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), this.chunkProviderSettings.gravelSize);
this.graniteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize);
this.dioriteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize);
this.andesiteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize);
this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize);
this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize);
this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), this.chunkProviderSettings.redstoneSize);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), this.chunkProviderSettings.diamondSize);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), this.chunkProviderSettings.lapisSize);
this.genDecorations(p_180292_3_);
this.currentWorld = null;
this.randomGenerator = null;
}
}
项目:DecompiledMinecraft
文件:BiomeDecorator.java
public void decorate(World worldIn, Random random, BiomeGenBase p_180292_3_, BlockPos p_180292_4_)
{
if (this.currentWorld != null)
{
throw new RuntimeException("Already decorating");
}
else
{
this.currentWorld = worldIn;
String s = worldIn.getWorldInfo().getGeneratorOptions();
if (s != null)
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b();
}
else
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b();
}
this.randomGenerator = random;
this.field_180294_c = p_180292_4_;
this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize);
this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), this.chunkProviderSettings.gravelSize);
this.graniteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize);
this.dioriteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize);
this.andesiteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize);
this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize);
this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize);
this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), this.chunkProviderSettings.redstoneSize);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), this.chunkProviderSettings.diamondSize);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), this.chunkProviderSettings.lapisSize);
this.genDecorations(p_180292_3_);
this.currentWorld = null;
this.randomGenerator = null;
}
}
项目:BaseClient
文件:BiomeDecorator.java
public void decorate(World worldIn, Random random, BiomeGenBase p_180292_3_, BlockPos p_180292_4_)
{
if (this.currentWorld != null)
{
throw new RuntimeException("Already decorating");
}
else
{
this.currentWorld = worldIn;
String s = worldIn.getWorldInfo().getGeneratorOptions();
if (s != null)
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b();
}
else
{
this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b();
}
this.randomGenerator = random;
this.field_180294_c = p_180292_4_;
this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize);
this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), this.chunkProviderSettings.gravelSize);
this.graniteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize);
this.dioriteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize);
this.andesiteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize);
this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize);
this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize);
this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize);
this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), this.chunkProviderSettings.redstoneSize);
this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), this.chunkProviderSettings.diamondSize);
this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), this.chunkProviderSettings.lapisSize);
this.genDecorations(p_180292_3_);
this.currentWorld = null;
this.randomGenerator = null;
}
}