add copy_to argument to createworld command - #2835
Conversation
…apack dimension paths
|
This seems wrong at a fundamental level. Path should be implicit from data input and logical process from there. Remember that createworld is also the load world command, and also the create without copying anything command. It needs to work equally and beautifully for all cases. |
the new layout is actually why I added the should i check if they specify the namespace, handle it differently for |
i know i can do either of of always infer the destination from the world name / namespace or infer namespaced dimensions while keeping normal worlds unchanged, i've decided to do the latter |
- resolve namespaced worlds under the main world's `dimensions` folder - keep normal world paths unchanged - resolve namespaced `copy_from` sources - validate namespaced world keys
Summary
this pull request adds a new
copy_toargument to thecreateworldcommand, allowing scripters to specify custom destination folder paths. this fixes pathing conflicts when initializing or copying worlds into modern datapack dimension subdirectories (eg,world/dimensions/minecraft/...).Problem
when using
createworldwithcopy_from, we previously locked the file destination path directly to the server root usingBukkit.getWorldContainer()plus the world name; with modern vanilla and Paper datapack dimensions, Bukkit initializes the dimension inside nested subfolders while Denizen was copying files to the root directory, completely ignoring the template files. the strictforbiddenSymbolssecurity check was rejecting any paths containing forward slashes (/), stopping scripters from passing normalized subdirectories entirely also which is going to be very necessary with world path formatting.Testing
copy_tocorrectly redirects file operations and lock cleanup (eg,uid.dat,session.lock) to the custom folder path while preserving standard Bukkit world registrationused various testing examples:
~createworld test_dimension copy_from:my_template copy_to:world/dimensions/minecraft/test_dimension~createworld mwtown_city copy_from:world/dimensions/minecraft/the_end environment:THE_END copy_to:world/dimensions/something/mwtown_city;here's a startup log referencing this test with tags parsed for verification:
https://files.behr.dev/file-share/createworld-copy-to-branch-latest.log
A working build of my latest successful build which has no errors can be built with this branch or found at:
https://files.behr.dev/file-share/denizen-createworld-copy-to.jar