I got this forge worldgen code from a tutorial and I'm wondering what this portion does. I understand how the code works, but I'm wondering what the inputs for WorldGenMinable does and how I can adjust where and how the ore spawns. Say I want iron-like spawning, what would I change? Diamond? Gold? I guess what I'm asking is that what do the numbers in the for loops and the new WorldGenMinable do?
public void generateSurface(Random random, int x, int z, World w){
for(int i = 0;i<4;i++){ //This goes through the ore metadata
for(int ii=0;ii<20;ii++){ //This makes it gen multiple times in each chunk
int posX = x + random.nextInt(16); //X coordinate to gen at
int posY = random.nextInt(40); //Y coordinate less than 40 to gen at
int posZ = z + random.nextInt(16); //Z coordinate to gen at
new WorldGenMinable(BoilerMod.copperOre.blockID,i,random.nextInt(9)).generate(w, random, posX, posY, posZ); //The gen call
}
}
Rollback Post to RevisionRollBack
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
new WorldGenMinable(block_id, block_meta, cluster_size)
for(int ii=0;ii<20;ii++){
int posX = x + random.nextInt(16); //X coordinate to gen at
int posY = random.nextInt(40); //Y coordinate less than 40 to gen at
int posZ = z + random.nextInt(16); //Z coordinate to gen at
}
Picks a random spot within the chunk to generate the cluster, the loop makes it generate 20 clusters per chunk. For more frequent ores, generate more clusters per chunk.
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
I mod things. Check me out on twitter or on Espernet IRC at #TheSteamTank
Picks a random spot within the chunk to generate the cluster, the loop makes it generate 20 clusters per chunk. For more frequent ores, generate more clusters per chunk.