Jump to content

Recommended Posts

Posted

I am making a mod with custom structures.

I have it all setup but the structures are not generating, i have no errors and i can't figure out what the problem is. Any help appreciated.

 

Main Class

 

  Reveal hidden contents

 

 

 

Generation class

 

  Reveal hidden contents

 

 

 

Structure class

 

  Reveal hidden contents

 

Posted

So you're picking a random Y value between 0 and 60 and looking for a valid spawn within three blocks of that Y value.

 

My guess is that it's simply not locating a valid location.

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.

Posted

As far as I know the GameRegistry.registerWorldGenerator(//BLA);

 

goes here:

@EventHandler
   public void Init(FMLInitializationEvent event){
      
   }

You put it in PreInit :)

Posted
  On 3/10/2015 at 8:50 PM, Dinoboychris said:

I have tried changing the random Y value all the way up to 200 but to no luck. And Brickfix if you look at my main class i am registering my generation class.

 

I don't think you understand what your code is doing.

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.

Posted

jep you registered it but you registered it at the wrong method, you should register it at your init method not at your preInit.

 

Secondly, your structure does not need to implement IWorldGenerate, to extend the WorldGenerator is enough.

 

And at last, my expirience with minecraft is that the terrain is never flat. So I would highly doubt that this will ever be a true argument:

if(!locationIsValidSpawn(world, i, j, k) || !locationIsValidSpawn(world, i + 18, j, k) || !locationIsValidSpawn(world, i + 18, j, k + 27) || !locationIsValidSpawn(world, i, j, k + 27))

 

I would recommend you disable the check and just generate it in a superflat world.

Also I would recommend do add this small line of code into your generator to make sure that it is actually called:

 

System.out.println("generating at: " + xCoord + ";" + zCoord);

 

I hope this helps a little

Posted

Your method setBlock, the one at the very bottom of your structure class, is doing nothing. Every time you want to generate a block your are actually not doing anything, this is why you don't find your house as it is not generating anywhere.

 

BTW, there seems to be nothing with distance in it (distance to the spawn I guess), basically your code will try to generate it in EVERY chunk.

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.