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

Separate HistoricLoad from LegacyLoad #618

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

BenCheung0422
Copy link
Member

@BenCheung0422 BenCheung0422 commented Feb 1, 2024

This depends on #610.
It is well-known and obvious that both Save and Load, even LegacyLoad are messy and chaotic. I separate the part of version loading that is not indicated by versioning. With my investigation, world save versioning is added in 1.9.1, but save system is implemented earlier, which means there are certain versions that there are no version indicators. Then, I reorganize to check the history and to clearly write a new loading mechanism for it. Ideally, this method could be beneficial for all loading behaviour, but it is a kind of more works to do, and I do this is just for the part of #581.
A on-demand auto data fixer is included.

`String#split` trims the trailing empty string so there is no empty string in the resultant list.
Copy link
Member

@Makkkkus Makkkkus left a comment

Choose a reason for hiding this comment

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

I suggest not touching LegacyLoad. It works as is, and is a collection of everything using the old save feature. That is fine, and should in theory just work indefinitly (if it isn't touched). I therefore advice that this pull request should be closed.

@BenCheung0422
Copy link
Member Author

There should be no big problem when the codes are not in a mess.

@BenCheung0422
Copy link
Member Author

Also, can you sure it can 100% work while it is not changed? It needs to be tidied up.

@BenCheung0422
Copy link
Member Author

Now when more problems fix, it is now working. Revisions for initial worlds tested: 9a09f53, 862a2e5, 585fef3

@BenCheung0422
Copy link
Member Author

HistoricLoad should now be completed.

@Litorom Litorom requested a review from Makkkkus February 14, 2024 16:42
@Makkkkus
Copy link
Member

I am still sceptical about changing this. LegacyLoad is fine as is all functions in it uses the old save format, and the current load file uses the new save format.

@BenCheung0422
Copy link
Member Author

BenCheung0422 commented Feb 16, 2024

Actually no, there were bugs with the old LegacyLoad class after tests. One of them is the IndexOutOfBoundsException with the rare corrupted worlds. Also, the current design of world loading classes and methods is not really safe and can easily crash. My version performs strict tests so that corrupted would not be loaded.

# Conflicts:
#	src/client/java/minicraft/saveload/Load.java
#	src/client/resources/assets/localization/en-us.json
# Conflicts:
#	src/client/java/minicraft/saveload/Load.java
# Conflicts:
#	src/client/java/minicraft/saveload/Load.java
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.

3 participants