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

I have a really hard time trying to fix this. I basically generate a structure in the world with a custom IWorldGenerator. Sometimes it happens when the structure is generated, it gets cut off at chunk borders.

I tried to force-load the chunks the structure is being built into, but this doesn't work either.

 

I will be grateful for any hint / advice for solving this.

 

Here's a screenshot of how the structure gets cut off:

http://puu.sh/7UX4K.jpg

 

Here's the IWorldGenerator class:

https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/world/EnderStuffWorldGenerator.java

 

And here's the actual class where the structure gen is happening:

https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/world/WorldGenEndLeak.java

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

I have this exact same problem and still have not found a perfect solution.

 

I was able to ameliorate it somewhat, however, by doing my generation on the final PopulateChunkEvents that post every time: GLOWSTONE for the Nether, and ICE for the overworld. LAKE actually is posted last, but it's not posted for every chunk.

 

If you want, you can see what I did here.

 

It's far from perfect, and in fact some of my secret rooms do still get chopped up by chunk borders; if your structure is less than 16x16 in area, as a last resort you can make sure it only ever generates in the center of a chunk; again, not ideal, but it should work.

 

Let me know if you ever come up with a better solution! This problem has been haunting me for months >.<

  • Author

I have this exact same problem and still have not found a perfect solution.

 

I was able to ameliorate it somewhat, however, by doing my generation on the final PopulateChunkEvents that post every time: GLOWSTONE for the Nether, and ICE for the overworld. LAKE actually is posted last, but it's not posted for every chunk.

 

If you want, you can see what I did here.

 

It's far from perfect, and in fact some of my secret rooms do still get chopped up by chunk borders; if your structure is less than 16x16 in area, as a last resort you can make sure it only ever generates in the center of a chunk; again, not ideal, but it should work.

 

Let me know if you ever come up with a better solution! This problem has been haunting me for months >.<

 

I've never noticed an event like this existed... It is actually a better solution, since dungeons themselves get also generated "at population".

I will tinker with it and observe the results, Thanks!

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

  • Author

So it seems the events fixed my problem, awesome!

Also I actually found the "true-last" event fired during population: PopulateChunkEvent.Post, but note that this is fired in the EVENT_BUS and not in the TERRAIN_GEN_BUS! I don't know if it's still the case in 1.7, though.

 

So here's my modified code:

WorldGenerator (it's now completely event-driven, IMO it's better than the IWorldProvider):

https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/world/EnderStuffWorldGenerator.java

 

And this is the Common Proxy, where I basically register the generator:

https://github.com/SanAndreasP/EnderStuffPlus/blob/code-cleanup/java/sanandreasp/mods/EnderStuffPlus/registry/CommonProxy.java#L42-L44

 

Thanks again, coolAlias for the tip!

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.