#2714: Remove unnecessary throws in ServerConnector
As ServerConnector's handle(PacketWrapper) method only checks whether packet.packet is null, its not necessary to cancel its execution by throwing CancelSendSignal.
This commit is contained in:
parent
c7984070a2
commit
74a6aa32a2
@ -21,7 +21,6 @@ import net.md_5.bungee.api.score.Score;
|
|||||||
import net.md_5.bungee.api.score.Scoreboard;
|
import net.md_5.bungee.api.score.Scoreboard;
|
||||||
import net.md_5.bungee.api.score.Team;
|
import net.md_5.bungee.api.score.Team;
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
import net.md_5.bungee.connection.CancelSendSignal;
|
|
||||||
import net.md_5.bungee.connection.DownstreamBridge;
|
import net.md_5.bungee.connection.DownstreamBridge;
|
||||||
import net.md_5.bungee.connection.LoginResult;
|
import net.md_5.bungee.connection.LoginResult;
|
||||||
import net.md_5.bungee.forge.ForgeConstants;
|
import net.md_5.bungee.forge.ForgeConstants;
|
||||||
@ -159,8 +158,6 @@ public class ServerConnector extends PacketHandler
|
|||||||
{
|
{
|
||||||
user.getForgeClientHandler().resetHandshake();
|
user.getForgeClientHandler().resetHandshake();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw CancelSendSignal.INSTANCE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -291,8 +288,6 @@ public class ServerConnector extends PacketHandler
|
|||||||
bungee.getPluginManager().callEvent( new ServerSwitchEvent( user ) );
|
bungee.getPluginManager().callEvent( new ServerSwitchEvent( user ) );
|
||||||
|
|
||||||
thisState = State.FINISHED;
|
thisState = State.FINISHED;
|
||||||
|
|
||||||
throw CancelSendSignal.INSTANCE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -316,7 +311,7 @@ public class ServerConnector extends PacketHandler
|
|||||||
{
|
{
|
||||||
obsolete = true;
|
obsolete = true;
|
||||||
user.connect( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
|
user.connect( event.getCancelServer(), ServerConnectEvent.Reason.KICK_REDIRECT );
|
||||||
throw CancelSendSignal.INSTANCE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String message = bungee.getTranslation( "connect_kick", target.getName(), event.getKickReason() );
|
String message = bungee.getTranslation( "connect_kick", target.getName(), event.getKickReason() );
|
||||||
@ -327,8 +322,6 @@ public class ServerConnector extends PacketHandler
|
|||||||
{
|
{
|
||||||
user.sendMessage( message );
|
user.sendMessage( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
throw CancelSendSignal.INSTANCE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -370,7 +363,7 @@ public class ServerConnector extends PacketHandler
|
|||||||
this.handshakeHandler.handle( pluginMessage );
|
this.handshakeHandler.handle( pluginMessage );
|
||||||
|
|
||||||
// We send the message as part of the handler, so don't send it here.
|
// We send the message as part of the handler, so don't send it here.
|
||||||
throw CancelSendSignal.INSTANCE;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user