Posted June 8, 20178 yr 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.
June 9, 20178 yr 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.
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.