Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regenerating a region #574

Closed
zml2008 opened this issue Apr 18, 2015 · 13 comments
Closed

Allow regenerating a region #574

zml2008 opened this issue Apr 18, 2015 · 13 comments

Comments

@zml2008
Copy link
Member

zml2008 commented Apr 18, 2015

Revert it to how it would look if it had when the world generator is first run.

Preferably accept an arbitrary Extent (possibly a plugin-implemented proy), might have to be a Chunk tho since world generation code is rather complex.

@Azatik
Copy link

Azatik commented Apr 18, 2015

1 - I used to be offered to the regeneration of the chunk. The answer was to Deamon5550: #360

2 - There is a problem with regeneration. How are we going to deal with it?
2014-12-29_18 33 14

@zml2008
Copy link
Member Author

zml2008 commented Apr 18, 2015

The deleteChunk method is no longer present in World. Still needs review.

That problem happens when the world generator changes (between MC versions usually). On the same generator, the same random seed is used meaning that the same results are given.

@ST-DDT
Copy link
Member

ST-DDT commented Apr 18, 2015

No trees and things like that are generated randomly. And if you try to restore villages the neighbor chunks have to be used.

@zml2008
Copy link
Member Author

zml2008 commented Apr 18, 2015

pseudo-randomly. same seed->same results

@Deamon5550
Copy link
Contributor

Yeah, so long as the world generator is not modified the chunk generation is deterministic.

Our options at this point is either a method to regenerate chunks, or one to delete them. Personally I'm in favour of the delete method as it can have uses beyond world regeneration like world trimming.

@progwml6
Copy link
Member

regeneration is vital in order to retroactively place things in the world that are needed for new plugins

@zml2008
Copy link
Member Author

zml2008 commented Apr 18, 2015

My only concern with delete vs regen is that this has to work if there are players still in the chunk.

@progwml6
Copy link
Member

regen should work when players are still in the chunk

@Deamon5550
Copy link
Contributor

That's a good point, I guess there is no real harm in having both for the two operations eh?

@zml2008
Copy link
Member Author

zml2008 commented Apr 18, 2015

your choice how to do it, I just need to be able to regenerate a portion of a chunk (well, a whole chunk works too) that still contains players.

@Deamon5550
Copy link
Contributor

While perfectly possible from an impl standpoint to re apply the generation steps to regenerate a chunk, the populators will currently not play nice with regenerating a single chunk as they populate a 16x16 area which is offset by 8 blocks by design. To allow regenerating a single chunk we're going to have to add parameters to the Populator.populate(World,Random) method specifying the area to populate.

For regeneration everything will be dandy as long as all the surrounding chunks already exist, if they don't or if we are deleting and regenerating later we have an issue of potentially creating an 8 block buffer where either we have not populated or have double populated.

We can handle this somewhat by populating an 8x8 area instead of a 16x16 area with our populators, however this will not play nice at all with modded biome decorates as we have limited control over where they are populating and no control at all over what size area they are populating.

I'll do some more investigation once #734 is merged.

@XakepSDK
Copy link

XakepSDK commented Mar 8, 2017

What about this?

@gabizou gabizou modified the milestones: Revision 6.1, Revision 6.0 Apr 29, 2017
@JBYoshi JBYoshi modified the milestones: Revision 6.1, Release 7.1 Jan 1, 2018
@Deamon5550 Deamon5550 removed their assignment Mar 16, 2018
@gabizou gabizou modified the milestones: Release 7.1, Undefined May 19, 2018
@bloodmc
Copy link
Contributor

bloodmc commented Feb 14, 2019

Chunk regeneration API support has been added in commit 6632f97

@bloodmc bloodmc closed this as completed Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests