Jump to content

Recommended Posts

Posted

I have no idea what's going on... I have 4 things set to genereate but for SOME reason, only one of them is and i have no flipping idea why. Any help is great, here's the gen code.

 

package IndustrialBreakout.world;

import java.util.Random;

import IndustrialBreakout.mod_IndustrialBreakout;
import net.minecraft.block.Block;
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 WorldGeneratorIB implements IWorldGenerator {
        @Override
        public void generate(Random r, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

    		int x = chunkX*16 +r.nextInt(16);
    		//int y = chunkY*16 +random.nextInt(16);
    		int z = chunkZ*16 +r.nextInt(16);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreTitanium.blockID, 1+r.nextInt(2), 16, 3);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreTin.blockID, 4 + r.nextInt(2), 32, 3);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreCopper.blockID, 6 + r.nextInt(6), 64, 10);
        	addOreGen(r, chunkX, chunkZ, world, mod_IndustrialBreakout.oreChargedCoal.blockID, 2 + r.nextInt(2), 16, 3);
        }
        
        private void addOreGen(Random r, int cX, int cZ, World w, int id, int numberOfGen, int y, int numOfVeins){		
        	for(int i = 0; i < numOfVeins; i++){
        		int x = cX*16 + r.nextInt(16);
        		int z = cZ*16 + r.nextInt(16);
        		(new WorldGenMinable(id, numberOfGen)).generate(w, r, x, y, z);
        	}
        }
        
}

Posted

have you tried following a tutorial? This way seems weird for me...

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Posted

Here is how I do generation:

 

https://github.com/ModderPenguin/JC-s-Dragons-Mod---add-ons/blob/master/source/motoolsnstuff/worldgen/WorldGeneratorDragonBros.java

 

And I realised that you had the right implementation, but I got it confused with another one :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Posted

Ah, you see, we kind of did ours similarly, i just didnt want to write out all those for loops. Also, i have a question. What is the point of calling the generateNether() and generateEnd() if there is nothing in them?

Posted

because then I have them there when I need them :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Posted

Ah... Well i am not going to screw with nether ores or end ores so i woudn't need those.. :)

I am going to switch styles of that code to see if it helps, but i really dont see much of a difference so... Yeah...

Posted

You NEED a new for loop everytime. You also NEED the switch statement. Just in case I read that wrong, sorry.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.