Jump to content

[1.11.2] looking for structure generation advice


salvestrom

Recommended Posts

in my previous mod i had a large structure - a village on a plateau. parts of the plateau that were generated on to already loaded chunks had trees buried in it and was undecorated.

 

i'd like to try something different in my current project so that i can better control structures spawning apart from each other while ensuring that the duplication of a world produces the exact same set of buildings in the exact same spot.

 

vanilla seems to generate a hashmap of structure starts and structure component coordinates. what happens then i'm just guessing at but i'm assuming each new chunk that loads checks the hashmap and if it finds matching coordinates generates whatever building is specified. i'm not clear on when/how the map is created. what happens if the player teleports 10km away??

 

i'd like to at least emulate this. a predetermined set of spawn points that a  iworldgenerator class can search when it recieves a new chunk and spawn any associated structures.

Link to comment
Share on other sites

I apologize that I can't give a full answer. What I do know is that much of chunk "decoration" is delayed until a chunk's SOUTH and EAST (+, +) neighbors have been created. That's when ores can be created -- and the vanilla ores are all offset +8, +8.

 

Because large constructs like strongholds and villages will span many chunks, they need to defer decoration even further (and it appears that you've analyzed part of that deferral). Look at how each large-scale construct (Stronghold, mine, fortress) is implemented. Imitate what you find.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.

Announcements



×
×
  • Create New...

Important Information

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