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

Update to 1.20.4 (Must be tested before merging) #65

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

TechPro424
Copy link
Contributor

@TechPro424 TechPro424 commented Dec 23, 2023

Updates the mod to 1.20.4

Needs to be tested

The method signature for the IntegratedServerLoader.start() method was changed in either 1.20.3 or 1.20.4
It now needs a runnable as the 2nd parameter (parameter name is onCancel)
So as of now the onCancel runnable is just a lambda function as I am not sure what the runnable should do (maybe return the player to the title screen?)
The runnable seems to be run whenever an exception is encountered while running the start() method and the world cannot be "recovered" (not too sure what that means)
needs to be tested

The RealmsGetServerDetailsTask seems to have been removed in either 1.20.3 or 1.20.4
The 2 Tasks that seemed to fit the most were OpenServerTask and RealmsPrepareConnectionTask
I looked into the OpenServerTask, and saw that if the boolean join was true, it would execute a play method in the RealmsMainScreen class that in turn runs the RealmsPrepareConnectionTask
Hence I decided to use the OpenServerTask for now
By fixing an inject to the startIntegratedServer method
The method signature had changed
@itsTyrion
Copy link

itsTyrion commented Feb 12, 2024

you can just check what the game does, there are 2 linked functions in the jdoc comments (@see net.minecraft.client.QuickPlay#startRealms)
correct, the lambda functions just set the screen in this case.
I made it cleaner in my PR (that I did without checking if there already is one xD)

… player to the title screen

Just found out that the onCancel lambda sends the player to the title screen, so made the mod replicate that
Thanks to itsTyrion on GitHub for pointing that out!
(See Bstn1802#65 (comment))
@TechPro424
Copy link
Contributor Author

you can just check what the game does, there are 2 linked functions in the jdoc comments (@see net.minecraft.client.QuickPlay#startRealms) correct, the lambda functions just set the screen in this case. I made it cleaner in my PR (that I did without checking if there already is one xD)

Thanks for pointing that out! Since there are 2 PRs, do you want me to close mine or are you ok with closing yours?

(Also I think you meant startSingleplayer there instead of startRealms)

…, replicating the vanilla game

Also removed the comments warning about the untested changes
@TechPro424
Copy link
Contributor Author

Also fixed the reconnectMethod override in RealmsReconnectStrategy

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.

2 participants