Skip to content

add copy_to argument to createworld command#2835

Open
BehrRiley wants to merge 3 commits into
DenizenScript:devfrom
BehrRiley:feature/createworld-copy-to
Open

add copy_to argument to createworld command#2835
BehrRiley wants to merge 3 commits into
DenizenScript:devfrom
BehrRiley:feature/createworld-copy-to

Conversation

@BehrRiley

Copy link
Copy Markdown
Contributor

Summary

this pull request adds a new copy_to argument to the createworld command, 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 createworld with copy_from, we previously locked the file destination path directly to the server root using Bukkit.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 strict forbiddenSymbols security 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

  • Tested on the latest supported patch-versions
  • Verified copy_to correctly redirects file operations and lock cleanup (eg, uid.dat, session.lock) to the custom folder path while preserving standard Bukkit world registration
    used 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant