-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support Spigot-style and vanilla-style world zips, for any server type #1305
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
Conversation
Spigot-family servers put the nether and end dimensions into separate world directories. Previously, the start-setupWorld script only had support for this layout when loading a Spigot-family jar. This commit adjusts the approach for detecting the Spigot layout, so that even when loading a vanilla jar, the correct world can be identified. Note that this commit does *not* fix actually loading Spigot nether and end dimensions on vanilla jars; it merely improves the detection for the main world directory.
shotah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see all the tests! Only real question I have is about the Paper vs Spigot.
| EULA: "TRUE" | ||
| SETUP_ONLY: "TRUE" | ||
| VERSION: ${MINECRAFT_VERSION:-LATEST} | ||
| TYPE: "PAPER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed in the folder name you called out spigot, but see you are using Paper. Probably just a typo or me not knowing enough about what is going on. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mostly protecting against the possibility of a future refactor accidentally making the Spigot logic conditional on TYPE (i.e. apply only to Spigot itself) instead of FAMILY (apply to all Spigot-style jars). It felt like overkill to write a whole separate test for it, but might as well catch it here.
| EULA: "TRUE" | ||
| SETUP_ONLY: "TRUE" | ||
| VERSION: ${MINECRAFT_VERSION:-LATEST} | ||
| TYPE: "PAPER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to know more of why we are using paper instead of spigot when that is declared in the folder name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spigot is effectively a dead release stream; however, it lives on as a "family" designation where Paper is a member of that family.
| @@ -0,0 +1,5 @@ | |||
| mc-image-helper assert fileExists world/level.dat && \ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see these, will need to go back and add for forge api and vanilla tweaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'm so happy to see others already using the new assertions I just added
| [ -d "${baseDir}_the_end" ] && rsync --remove-source-files --recursive --delete "${baseDir}_the_end/" "${worldDest}_the_end" | ||
| if [ -d "${baseDir}_nether" ]; then | ||
| log "Copying Spigot Nether..." | ||
| rsync --remove-source-files --recursive --delete "${baseDir}_nether/" "${worldDest}_nether" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, curious if we couldn't make all these rsync's a single method that takes in "${baseDir}_nether" and "${worldDest}_nether". It really may clean up these lines 82 - 107. Either way this is great stuff and it doesn't need to happen, just thought it may make it easier to read and troubleshoot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an FYI, I am gradually converting rsync usage over to sync subcommand of mc-image-helper, which takes a subset of the arguments here
https://github.com/itzg/mc-image-helper#sync-and-interpolate
itzg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great. I'll wait to merge until I hear back if there's any final tweaks you want to make based on review.
| rm -r "$baseDir/DIM-1" | ||
| fi | ||
| fi | ||
| if [ -d "${baseDir}_the_end/DIM1" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got love their consistency 😊
| @@ -0,0 +1,5 @@ | |||
| mc-image-helper assert fileExists world/level.dat && \ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'm so happy to see others already using the new assertions I just added
| mc-image-helper assert fileExists world/level.dat && \ | ||
| mc-image-helper assert fileExists world_nether/DIM-1/some_spigot_nether_file && \ | ||
| mc-image-helper assert fileExists world_the_end/DIM1/some_spigot_end_file && \ | ||
| ! mc-image-helper assert fileExists world_nether/DIM-1/some_vanilla_nether_file && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I don't even need to add the "not" versions of assertions now that I see this technique.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might still be nice to have "not" versions so that the output can be silent when the test passes and explanatory when it fails, like we get for the non-negated case. Not a huge deal though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. Assertions are easy to add, so I'll get that queued up.
| @@ -0,0 +1,5 @@ | |||
| mc-image-helper assert fileExists world/level.dat && \ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to test the test, but it should be executing these will fail-fast so probably don't even need to chain these together with &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately not; I tested without && and with some of the asserts negated and it passed, even when it shouldn't have.
We could also add a set -e at the top of each verify script rather than &&-chaining, or we could source the verify scripts from a shell with set -e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the latter was the case, so I need to look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found and fixed the missing -e
| EULA: "TRUE" | ||
| SETUP_ONLY: "TRUE" | ||
| VERSION: ${MINECRAFT_VERSION:-LATEST} | ||
| TYPE: "PAPER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spigot is effectively a dead release stream; however, it lives on as a "family" designation where Paper is a member of that family.
|
From my perspective the review suggestions here are all good, but I don't see any of them as blockers to this PR; unless you feel strongly about them I'd be inclined to leave them for a future cleanup. Personally I'd still like to do some real-world testing, but if you think the unit tests are good enough that works for me too. |
|
No expectations on my part for any changes that are needed. I'm good with merging at this point or waiting until you have done more real world testing. Just let me know when you're ready. |
|
Hi @wlritchi , just wanted to check in and see how testing was going. |
|
Sorry for the lack of activity with this; I've been on call for my day job over the last week so I haven't had a chance to put much time into side projects. I've got some time today, so I'm planning to do a few tests of this PR on my infra within the next 24 hours; I'll update you with the results. Thanks for checking in! |
|
No problem at all. I did my oncall rotation just a couple of weeks ago, so I hear ya. |
|
Edit: retracted; I was seeing unexpected behaviour with portals, but the world was in fact loading correctly. |
|
Update to my above comment: for reasons unknown, Spigot zips are failing to retain links from portals in the nether to portals in the overworld, but only on first load. I've seen this same behaviour with the existing implementation, so it's not a regression nor a problem with this PR (still worth opening a ticket to look at though). Since I had logged out in the nether on my testing worlds, this led me to arrive at a new, unrecognized location when I returned to the overworld on the final servers. I incorrectly believed that the overworld was being regenerated; in fact I was just somewhat far from where I expected to be. Apologies for the false alarm above, but I wanted to block this PR from being merged while there was any doubt. I now assess that this PR passes manual tests, and can be merged safely. |
Thanks for being thorough. Merge is on the way! |
Spigot-family servers put the Nether and End dimensions into separate world directories. Previously, the start-setupWorld script could only accept this layout when passing it to a Spigot-family jar.
This PR adjusts the approach for detecting the Spigot world layout, so that it can be applied when loading any server jar. It also adjusts the logic for world copying so that the extra dimensions will be loaded into the correct place. If the script finds both a Spigot-style and a vanilla-style Nether (or End), the Spigot-style one will take precedence. This matches the default behaviour of Spigot-family jars.
Fixes #1290