Jump to content

WorldGeneration not generating..


Naddox

Recommended Posts

Hey all, I am trying to get some of my blocks to generate in my worlds. I have made a world gen class and registered it within my main class and have no issues at all there or in my world gen class, but nothing new generates in my worlds. Can someone please help me out?

 

I am using this tutorial as a semi-base: http://www.minecraftforge.net/wiki/Adding_World_Generation

and using the generated code from MCreator for the code to generate: http://pastebin.com/aMH988h3

 

Main Class: http://pastebin.com/330u2s3w

World Gen Class: http://pastebin.com/ThDu7qci

Link to comment
Share on other sites

One thing:

 

 int randPosX = chunkX + rand.nextInt(16);
                        int randPosY = rand.nextInt(250)+0;
                        int randPosZ = chunkZ + rand.nextInt(16);

 

ChunkX = 5

randPosX = 5 + [0-15]

 

Gee, I wonder where it's going to end up.

(You have to multiply your chunk X/Z by 16).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

dont know where you got that 5 or the 5(0+15) but it is multiplied by 16...

 

No it's not.

 

chunkX is not premultiplied and it's certainly not being muliplied before it gets passed on WorldGenMinable.

 

Oh, and if it's magically getting multiplied after you add the random value, you're still doing it wrong.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Here is where I got the code, mod generated from MCreator, and this works 100% perfectly fine.

http://pastebin.com/66cgUXMJ

 

line 142-149

 

public void generateSurface(World world, java.util.Random rand, int chunkX, int chunkZ){
for(int i = 0; i < 40; i++){
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256)+0;
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_quartzOverworld.block.blockID, 40)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}

Link to comment
Share on other sites

Do this:

 

System.out.println("RandPosX: " + randPosX);

 

(or use whatever printing statement you like) and run it.  Check the outputted values and insure that they're within the expected range.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.

×
×
  • Create New...

Important Information

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