FML 3 marker

This commit is contained in:
Adrian Bergqvist 2023-02-08 19:54:43 +01:00
parent 3172c5f672
commit e1acc461a7
No known key found for this signature in database
GPG Key ID: FAE7D8EDE225E686

View File

@ -23,8 +23,8 @@ public class FMLMarkerAdder extends MessageToMessageEncoder<Handshake> {
MinecraftConnection connection = (MinecraftConnection) ctx.pipeline().get(Connections.HANDLER);
VelocityServerConnection serverConnection = (VelocityServerConnection) connection.getAssociation();
if (serverConnection.getPlayer().getConnection().getType() instanceof ForgeFMLConnectionType) {
msg.setServerAddress(msg.getServerAddress() + ForgeConstants.FML2Marker);
if (serverConnection.getPlayer().getConnection().getType() instanceof ForgeFMLConnectionType FMLType) {
msg.setServerAddress(msg.getServerAddress() + (FMLType == ForgeConstants.ForgeFML3 ? ForgeConstants.FML3Marker : ForgeConstants.FML2Marker));
}
out.add(msg);
ctx.pipeline().remove(this);