Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Gatekeep RequestAbilityPackets to 1.19.30+
Dieser Commit ist enthalten in:
Ursprung
64c03b9610
Commit
4e2d750791
@ -95,6 +95,10 @@ public final class GameProtocol {
|
||||
return session.getUpstream().getProtocolVersion() >= Bedrock_v534.V534_CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
public static boolean supports1_19_30(GeyserSession session) {
|
||||
return session.getUpstream().getProtocolVersion() >= Bedrock_v554.V554_CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
||||
*
|
||||
|
@ -30,6 +30,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server
|
||||
import com.nukkitx.protocol.bedrock.data.Ability;
|
||||
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
|
||||
import com.nukkitx.protocol.bedrock.packet.RequestAbilityPacket;
|
||||
import org.geysermc.geyser.network.GameProtocol;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
@ -42,6 +43,11 @@ public class BedrockRequestAbilityTranslator extends PacketTranslator<RequestAbi
|
||||
|
||||
@Override
|
||||
public void translate(GeyserSession session, RequestAbilityPacket packet) {
|
||||
// Gatekeep to 1.19.30 so older versions don't fire twice
|
||||
if (!GameProtocol.supports1_19_30(session)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (packet.getAbility() == Ability.FLYING) {
|
||||
handle(session, packet.isBoolValue());
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren