Jump to content

Recommended Posts

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.

Posted

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

Posted

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.

Posted

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

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