From d1dd7379b127b413ab579f929cfa579d832af09c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 10:23:21 +1000 Subject: [PATCH] Use cleaner equals check and actually set member field --- .../java/net/md_5/bungee/protocol/packet/PacketD1Team.java | 3 ++- proxy/src/main/java/net/md_5/bungee/ServerConnector.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PacketD1Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PacketD1Team.java index 9ffc3fee0..69bf3771e 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PacketD1Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PacketD1Team.java @@ -36,7 +36,8 @@ public class PacketD1Team extends DefinedPacket public PacketD1Team(String name) { this(); - mode = 1; + this.name = name; + this.mode = 1; } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 8439ceb42..0983d67e2 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -266,7 +266,7 @@ public class ServerConnector extends PacketHandler @Override public void handle(PacketFAPluginMessage pluginMessage) throws Exception { - if ( pluginMessage.getData().length == 0 && pluginMessage.getTag().equals( "BungeeCord" ) ) + if ( pluginMessage.equals( PacketConstants.I_AM_BUNGEE) ) { throw new IllegalStateException( "May not connect to another BungeCord!" ); }