Clean up some connection checks
This commit is contained in:
@@ -134,11 +134,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startHandshake() {
|
private void startHandshake() {
|
||||||
MinecraftConnection mc = connection;
|
final MinecraftConnection mc = ensureConnected();
|
||||||
if (mc == null) {
|
|
||||||
throw new IllegalStateException("No connection established!");
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerInfoForwarding forwardingMode = server.getConfiguration().getPlayerInfoForwardingMode();
|
PlayerInfoForwarding forwardingMode = server.getConfiguration().getPlayerInfoForwardingMode();
|
||||||
|
|
||||||
// Initiate the handshake.
|
// Initiate the handshake.
|
||||||
@@ -214,10 +210,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
Preconditions.checkNotNull(identifier, "identifier");
|
Preconditions.checkNotNull(identifier, "identifier");
|
||||||
Preconditions.checkNotNull(data, "data");
|
Preconditions.checkNotNull(data, "data");
|
||||||
|
|
||||||
MinecraftConnection mc = connection;
|
MinecraftConnection mc = ensureConnected();
|
||||||
if (mc == null) {
|
|
||||||
throw new IllegalStateException("Not connected to a server!");
|
|
||||||
}
|
|
||||||
|
|
||||||
PluginMessage message = new PluginMessage();
|
PluginMessage message = new PluginMessage();
|
||||||
message.setChannel(identifier.getId());
|
message.setChannel(identifier.getId());
|
||||||
|
Reference in New Issue
Block a user