-
Notifications
You must be signed in to change notification settings - Fork 65
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
Support 1.21.2 - 1.21.4 #98
base: main
Are you sure you want to change the base?
Conversation
I created #104 to add support for 1.21.4 based on your work, thanks! |
I updated to 1.21.4, but something might have broken on older versions. Let me know if something breaks |
1.21.1 - Network protocol error |
Fixed 1.21.1. However, I can't reproduce the bug on 1.20.6. How does it look for you? Everything is correct for me. |
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.
Shouldn't it be changed like this?
if (version.moreOrEqual(Version.V1_21)) {
msg.writeVarInt(dimensionRegistry.getDimension_1_21().getId());
}
else {
msg.writeVarInt(dimensionRegistry.getDimension_1_20_5().getId());
}
Applying this will fix the issue in 1.21.1, but will still cause issues in 1.20.5.
@@ -300,6 +300,28 @@ public void encode(ByteMessage msg, Version version) { | |||
msg.writeVarInt(0); |
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.
^
msg.writeVarInt(dimensionRegistry.getDimension_1_20_5().getId());
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.
if (version.moreOrEqual(Version.V1_21)) {
msg.writeVarInt(dimensionRegistry.getDimension_1_21().getId());
}
else {
msg.writeVarInt(dimensionRegistry.getDimension_1_20_5().getId());
}
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.
Codec 1.20.5 and 1.21 use the same dimension ids, so this is not required
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.
LGTM
Mojang changed the LoginSuccess, JoinGame and PlayerPositionAndLook packets.
And also starting from 1.20.5 it is no longer necessary to send the client a full codec with registers.
Instead, a KnownPacks and UpdateTags packets is sent which synchronizes the registers, just like the vanilla server does.
In addition, all dependencies have been updated and some places in the code have been improved.
I also added github actions to automatically build a jar file when creating a release.