Anticipate support for the patch version of 1.19.60

This commit is contained in:
Camotoy 2023-02-15 16:17:38 -05:00
parent ee754c529b
commit 30277d5411
3 changed files with 12 additions and 1 deletions

View file

@ -75,6 +75,10 @@ public final class GameProtocol {
.minecraftVersion("1.19.50/1.19.51")
.build());
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC);
// So the version checker will work
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC.toBuilder()
.protocolVersion(568)
.build());
}
/**

View file

@ -31,6 +31,8 @@ import com.nukkitx.protocol.bedrock.data.ExperimentData;
import com.nukkitx.protocol.bedrock.data.PacketCompressionAlgorithm;
import com.nukkitx.protocol.bedrock.data.ResourcePackType;
import com.nukkitx.protocol.bedrock.packet.*;
import com.nukkitx.protocol.bedrock.v567.Bedrock_v567;
import com.nukkitx.protocol.bedrock.v567.Bedrock_v567patch;
import org.geysermc.geyser.Constants;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.api.network.AuthType;
@ -141,6 +143,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
return true;
}
// Hack for... whatever this is
if (loginPacket.getProtocolVersion() == Bedrock_v567.V567_CODEC.getProtocolVersion() && !session.getClientData().getGameVersion().equals("1.19.60")) {
session.getUpstream().getSession().setPacketCodec(Bedrock_v567patch.BEDROCK_V567PATCH);
}
PlayStatusPacket playStatus = new PlayStatusPacket();
playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS);
session.sendUpstreamPacket(playStatus);