Which version of Minecraft and which spawn rate are you talking about?
Emerald Ore in Extreme Hills? That's handled by BiomeGenHills#decorate in 1.7.10 and 1.8.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
public class WorldOreGen implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId){
case -1:
generateNether(random, chunkX * 16, chunkZ * 16, world);
break;
case 0:
generateSurface(random, chunkX * 16, chunkZ * 16, world);
break;
case 1:
generateEnd(random, chunkX * 16, chunkZ * 16, world);
break;
default:
;
}
}
private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance){
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);
private void generateNether(Random random, int chunkX, int chunkZ, World world) {
// TODO Auto-generated method stub
Im wondering what number would the spawnrate of emerald be in this method at spawnChance:
private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance)
Emerald Ore uses manual World#setBlock calls rather than WorldGenMinable, but it's roughly equivalent to calling your addOre method with minY = 4, maxY = 31, minVeinSize = 1, maxVeinSize = 1 and spawnChance = 3 + random.nextInt(6).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So when i call addOre the spawnChance if im trying to slightly mimic emerald would have to be 3(or any other number)+random.nextInt(6) ?
Yes.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hi im wondering what is the numerical spawnrate of emeralds
Which version of Minecraft and which spawn rate are you talking about?
Emerald Ore in Extreme Hills? That's handled by BiomeGenHills#decorate in 1.7.10 and 1.8.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
edit: deleted
package com.craftxbox.world;
import java.util.Random;
import com.craftxbox.block.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldOreGen implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId){
case -1:
generateNether(random, chunkX * 16, chunkZ * 16, world);
break;
case 0:
generateSurface(random, chunkX * 16, chunkZ * 16, world);
break;
case 1:
generateEnd(random, chunkX * 16, chunkZ * 16, world);
break;
default:
;
}
}
private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance){
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(block, (minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), blockSpawn).generate(world, random, xPos, yPos, zPos);
}
}
private void generateEnd(Random random, int chunkX, int chunkZ, World world) {
// TODO Auto-generated method stub
}
private void generateSurface(Random random, int chunkX, int chunkZ, World world) {
addOre(ModBlocks.oreRuby, Blocks.stone, random, world, chunkX, chunkZ, 0, 18, 1, 2, 5);
addOre(ModBlocks.oreSapphire, Blocks.stone, random, world, chunkX, chunkZ, 0, 18, 1, 2, 4);
}
private void generateNether(Random random, int chunkX, int chunkZ, World world) {
// TODO Auto-generated method stub
Im wondering what number would the spawnrate of emerald be in this method at spawnChance:
private void addOre(Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVeinSize, int maxVeinSize, int spawnChance)
Emerald Ore uses manual World#setBlock calls rather than WorldGenMinable, but it's roughly equivalent to calling your addOre method with minY = 4, maxY = 31, minVeinSize = 1, maxVeinSize = 1 and spawnChance = 3 + random.nextInt(6).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So when i call addOre the spawnChance if im trying to slightly mimic emerald would have to be 3(or any other number)+random.nextInt(6) ?
Yes.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.