13
0
geforkt von Mirrors/Velocity

Unbreak Forge logic.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-10-05 19:04:10 -04:00
Ursprung d59c8874b7
Commit 222e90a9f0

Datei anzeigen

@ -94,14 +94,15 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
serverConn.getPlayer().sendLegacyForgeHandshakeResetPacket();
}
// Always forward these messages during login
// Always forward these messages during login. Don't pass it onto the handleGeneric below.
return false;
}
ChannelIdentifier id = server.getChannelRegistrar().getFromId(packet.getChannel());
if (id == null) {
serverConn.getPlayer().getConnection().write(packet);
} else {
return false;
}
PluginMessageEvent event = new PluginMessageEvent(serverConn, serverConn.getPlayer(), id, packet.getData());
server.getEventManager().fire(event)
.thenAcceptAsync(pme -> {
@ -109,7 +110,6 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
serverConn.getPlayer().getConnection().write(packet);
}
}, serverConn.getConnection().eventLoop());
}
return true;
}
@ -134,11 +134,9 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
return;
}
if (serverConn.hasCompletedJoin()) {
// Just forward the packet on. We don't have anything to handle at this time.
serverConn.getPlayer().getConnection().write(packet);
}
}
@Override
public void handleUnknown(ByteBuf buf) {
@ -149,10 +147,8 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
return;
}
if (serverConn.hasCompletedJoin()) {
serverConn.getPlayer().getConnection().write(buf.retain());
}
}
@Override
public void exception(Throwable throwable) {