mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Move version check to GameProtocol
This commit is contained in:
parent
7675d91124
commit
edd4896f96
2 changed files with 6 additions and 2 deletions
|
@ -97,6 +97,10 @@ public final class GameProtocol {
|
|||
return session.getUpstream().getProtocolVersion() < Bedrock_v685.CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
public static boolean isPre1_21_2(GeyserSession session) {
|
||||
return session.getUpstream().getProtocolVersion() < Bedrock_v686.CODEC.getProtocolVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
|
||||
*
|
||||
|
|
|
@ -141,6 +141,7 @@ import org.geysermc.geyser.item.type.BlockItem;
|
|||
import org.geysermc.geyser.level.BedrockDimension;
|
||||
import org.geysermc.geyser.level.JavaDimension;
|
||||
import org.geysermc.geyser.level.physics.CollisionManager;
|
||||
import org.geysermc.geyser.network.GameProtocol;
|
||||
import org.geysermc.geyser.network.netty.LocalSession;
|
||||
import org.geysermc.geyser.registry.Registries;
|
||||
import org.geysermc.geyser.registry.type.BlockMappings;
|
||||
|
@ -2117,8 +2118,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
|
||||
@Override
|
||||
public void closeForm() {
|
||||
// TODO remove once 1.21.2 is lowest supported version
|
||||
if (upstream.getProtocolVersion() >= 686) {
|
||||
if (!GameProtocol.isPre1_21_2(this)) {
|
||||
sendUpstreamPacket(new ClientboundCloseFormPacket());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue