Merge pull request #1419 from Dimatert9/master

Do not use Bukkit#sendPluginMessage
This commit is contained in:
Gabriele C 2017-11-20 13:08:14 +01:00 committed by GitHub
commit f23b8933ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -363,8 +363,4 @@ public class BukkitService implements SettingsDependent {
public BanEntry banIp(String ip, String reason, Date expires, String source) { public BanEntry banIp(String ip, String reason, Date expires, String source) {
return Bukkit.getServer().getBanList(BanList.Type.IP).addBan(ip, reason, expires, source); return Bukkit.getServer().getBanList(BanList.Type.IP).addBan(ip, reason, expires, source);
} }
public void sendPluginMessage(String channel, byte[] data) {
Bukkit.getServer().sendPluginMessage(authMe, channel, data);
}
} }

View File

@ -1,5 +1,6 @@
package fr.xephi.authme.service.bungeecord; package fr.xephi.authme.service.bungeecord;
import com.google.common.collect.Iterables;
import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
@ -52,7 +53,10 @@ public class BungeeSender implements SettingsDependent {
for (String element : data) { for (String element : data) {
out.writeUTF(element); out.writeUTF(element);
} }
bukkitService.sendPluginMessage("BungeeCord", out.toByteArray()); Player player = Iterables.getFirst(plugin.getServer().getOnlinePlayers(), null);
if (player != null) {
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
}
} }
/** /**