What would be the best way to make the world regenerate itself automatically after 1 week while also keeping claimed chunks? Do i need to track every block placement/break and its date and then have one scheduled task to loop through all chunks that were last interacted with more than 1 week ago or is there a better solution? And how performance intensive would that be?
#Regenerating griefed chunks after specific period of time
1 messages · Page 1 of 1 (latest)
You could in theory regen the chunk from the world generator
So you don’t have to track anything
ive never done anything with world generators
isn't there just a method regenerateChunk() or sth?
Worldedit might have api for it
I think it’s no longer functional
Could be wrong
Copy claimed chunks into new world folder and generate new world with same seed 🙂
and would that allow having the chunk reset after 1 week of THEIR grief. I dont want the whole world to be regenerated every week
Ah
yea deprecated
hm the javadocs only say it might not recreate the exact same chunk, but no clue
Hmm, well you can try it
and does the server lag when regenerating a chunk?
PS: Use a queue filled with simple
records for tracking.
{
restoreTime: long
chunkX: int
chunkZ: int
}
Every chunk is regenerated in order. So if the highest track in the queue doesnt need regeneration, then you dont need to check any of the others. This way you can very efficiently poll the queue from the top.
wow thats smart
so tracking block changes and restoreTime is the best solution right?
If you do the entire chunk you just need to track the first change
Or the last depending on what you want
But if you can’t regen the entire chunk you’d have to track everything
Should probably have some sort of hash collection like a HashSet or HashMap to check if a chunk is allready tracked in O(1)
The tricky part is consistently regenerating the chunk in a way that performs well
the idea of the plugin is to have ChunkClaims that are protected and will never reset. Everything unclaimed will be reset after 1 week of inactivity
and survival
Generally you just do a resource world for this
and then copy each block one by one over?
Hm if your world has a big size then you should probably generate chunks lazily. Meaning if a chunk is due for regeneration, then simply move it
from the queue into a set. Then on chunk load, check if the loaded chunk is one that is in this set (and due for regeneration).
You dont want your server to randomly load tons of chunks in the farlands just to regenerate them.
thats so flippin smart