Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.