hollow-cube / minestom-ce

1.20.4 Lightweight Minecraft server
https://minestom.net
Apache License 2.0
108 stars 36 forks source link

`InstanceContainer#copy()` does not work for unloaded instances #140

Closed zax71 closed 7 months ago

zax71 commented 7 months ago

If you use an InstanceContainer that has not yet been loaded when copying it, the resultant InstanceContainer will be empty. To get around this, I can use InstanceContainer#loadChunk() but imo InstanceContainer#copy() should do this automatically

mworzala commented 7 months ago

This is expected behavior. You need to load the chunks you want to copy.

Loading them automatically does not make much sense. In most cases there is not a simple way to know all of the chunks, and loading them all is unnecessary at best, problematic at worst if it's a big world.