Skip to content
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

Add option to only backup claimed chunks #101

Merged
merged 22 commits into from
Sep 13, 2024

Conversation

Lyfts
Copy link
Member

@Lyfts Lyfts commented Aug 6, 2024

I didn't feel like dealing with the merge conflicts so it's currently based on #100 and will be drafted for now,

This extracts only the chunks that are claimed and saves them to a temporary region file which then gets zipped up, the final result is much much smaller than your usual backup and created in a fraction of the time.

Here is two chunks about to be mercilessly blown up, the one on the left is claimed and the one on the right is not. Above them is a chest full of delicious melon.
pre

This is after several OSHA violations occured and is also when the backup was taken.
explode

And finally we have the chunks after the backup was restored. This shows that only the claimed chunk remained in it's previous state while the unclaimed one was regenerated from new. (two of the obisidian lines were outside the chunk border)

The melons survived too

melon

post

Old test which showed a mysterious patch of mossy cobble regenerating in the claimed chunk

This line of tnt is directly on a chunk border between a claimed (on the left side of the tnt) and an unclaimed chunk
tnt_line

This is the result of the explosion
post_explosion

And this is after restoring from a backup, showing that only the claimed chunk on the left remained the same while the unclaimed regenerated from new. For unknown reasons Minecraft generated a patch of mossy cobble in the claimed chunk after restoring from backup, which will need to be investigated.

post_backup

Closes #75

@Lyfts
Copy link
Member Author

Lyfts commented Aug 6, 2024

Just tested this on my old UMV world where it brought the backup size down from 3.2GB to just 34MB whilst keeping my entire base & all my many random claims intact and working.

It was small enough that it only took a staggering 5 seconds to upload it as proof if anyone wants to check it out

@S4mpsa
Copy link

S4mpsa commented Aug 6, 2024

This should require a Void Miner controller to enable, otherwise it provides infinite resources 👏

@Caedis
Copy link
Member

Caedis commented Aug 6, 2024

@S4mpsa if people are purposely restoring backups, they might as well give themself creative mode

@S4mpsa
Copy link

S4mpsa commented Aug 6, 2024

It was more of a joke, I don't think we can enforce config options with in-game progression 😅

@Caedis
Copy link
Member

Caedis commented Aug 7, 2024

@jusvit you need to update gtnhlib

@jusvit
Copy link

jusvit commented Aug 7, 2024

Results for 6GB Server world with 19 teams (~25 players)

Log

[Server Utilities]: Backed up 103 regions containing 3408 claimed chunks
[Server Utilities]: Backup done in 00:19 seconds (94.5MB)!

Results

Not good, chunks are mix and matched, looks like the matrix.

Although the zip size is 98.471% decrease from a complete backup :)

Expand

This should be flat grass (personal dimension) but it seems to have sections of the nether, and the overworld.

image

This is the overworld but it has my personal dimension base there.
image

This is my personal dimension, it seems to have my moon base, a bit of my original overworld base, some nether chunks and my actual base at the back.
image

Not sure what's going on, I think the claims were copied to each dimensions and overlapped.
The original bases (in their actual location) all seem good and dandy.

I can provide you the world if you want, I sent you a friend request on discord, accept if you want the world.

@jusvit
Copy link

jusvit commented Aug 8, 2024

Fixes look good, chunks are as-expected.

@Caedis
Copy link
Member

Caedis commented Aug 8, 2024

Is this going to be default on?

@Lyfts
Copy link
Member Author

Lyfts commented Aug 8, 2024

Nah it will be disabled by default

@Dream-Master Dream-Master marked this pull request as ready for review September 13, 2024 05:38
@Dream-Master
Copy link
Member

@Lyfts i open this because #100 is now approved and merged .

@Lyfts Lyfts requested a review from a team September 13, 2024 05:55
…ed-chunks

# Conflicts:
#	src/main/java/serverutils/ServerUtilitiesConfig.java
#	src/main/java/serverutils/task/backup/BackupTask.java
#	src/main/java/serverutils/task/backup/ThreadBackup.java
Copy link
Contributor

@Ethryan Ethryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dream-Master Dream-Master merged commit b82a106 into master Sep 13, 2024
1 check passed
@Dream-Master Dream-Master deleted the backup-only-claimed-chunks branch September 13, 2024 12:42
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.

[Feature Request] Only backup claimed chunks (Option)
6 participants