mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-01-05 10:24:35 +01:00
Reintroduce hack
This commit is contained in:
parent
d64c0b38da
commit
7bd11ee3c3
1 changed files with 18 additions and 0 deletions
|
@ -963,6 +963,8 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
// Start ticking
|
// Start ticking
|
||||||
tickThread = eventLoop.scheduleAtFixedRate(this::tick, 50, 50, TimeUnit.MILLISECONDS);
|
tickThread = eventLoop.scheduleAtFixedRate(this::tick, 50, 50, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
this.protocol.setUseDefaultListeners(false);
|
||||||
|
|
||||||
TcpSession downstream;
|
TcpSession downstream;
|
||||||
if (geyser.getBootstrap().getSocketAddress() != null) {
|
if (geyser.getBootstrap().getSocketAddress() != null) {
|
||||||
// We're going to connect through the JVM and not through TCP
|
// We're going to connect through the JVM and not through TCP
|
||||||
|
@ -997,6 +999,22 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
||||||
// We'll handle this since we have the registry data on hand
|
// We'll handle this since we have the registry data on hand
|
||||||
downstream.setFlag(MinecraftConstants.SEND_BLANK_KNOWN_PACKS_RESPONSE, false);
|
downstream.setFlag(MinecraftConstants.SEND_BLANK_KNOWN_PACKS_RESPONSE, false);
|
||||||
|
|
||||||
|
// This isn't a great solution, but... we want to make sure the finish configuration packet cannot be sent
|
||||||
|
// before the KnownPacks packet.
|
||||||
|
this.downstream.getSession().addListener(new ClientListener(ProtocolState.LOGIN, loginEvent.transferring()) {
|
||||||
|
@Override
|
||||||
|
public void packetReceived(Session session, Packet packet) {
|
||||||
|
if (protocol.getInboundState() == ProtocolState.CONFIGURATION) {
|
||||||
|
if (packet instanceof ClientboundFinishConfigurationPacket) {
|
||||||
|
// Prevent
|
||||||
|
GeyserSession.this.ensureInEventLoop(() -> GeyserSession.this.sendDownstreamPacket(new ServerboundFinishConfigurationPacket()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.packetReceived(session, packet);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
downstream.addListener(new SessionAdapter() {
|
downstream.addListener(new SessionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void packetSending(PacketSendingEvent event) {
|
public void packetSending(PacketSendingEvent event) {
|
||||||
|
|
Loading…
Reference in a new issue