Add ServerInfo method to send plugin message only if server is online

This commit is contained in:
Jonas Konrad
2014-07-23 16:59:36 +02:00
committed by md_5
parent 8676dd47f6
commit b544bb34cb
2 changed files with 25 additions and 2 deletions

View File

@@ -88,9 +88,15 @@ public class BungeeServerInfo implements ServerInfo
return address.hashCode();
}
// TODO: Don't like this method
@Override
public void sendData(String channel, byte[] data)
{
sendData( channel, data, true );
}
// TODO: Don't like this method
@Override
public boolean sendData(String channel, byte[] data, boolean queue)
{
Preconditions.checkNotNull( channel, "channel" );
Preconditions.checkNotNull( data, "data" );
@@ -101,10 +107,12 @@ public class BungeeServerInfo implements ServerInfo
if ( server != null )
{
server.sendData( channel, data );
} else
return true;
} else if ( queue )
{
packetQueue.add( new PluginMessage( channel, data ) );
}
return false;
}
}