Bugfix Plugin Messaging Channel
This commit is contained in:
@@ -16,10 +16,10 @@ public class BCommand_Sender_Reciver {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
if (console){
|
||||
if (console) {
|
||||
output.writeUTF("T2Code-Console");
|
||||
} else {
|
||||
if (sender instanceof Player){
|
||||
if (sender instanceof Player) {
|
||||
output.writeUTF(sender.getName());
|
||||
} else {
|
||||
output.writeUTF("T2Code-Console");
|
||||
@@ -29,7 +29,15 @@ public class BCommand_Sender_Reciver {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Bukkit.getServer().sendPluginMessage(Main.plugin, "t2codealias:bungee", stream.toByteArray());
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
player.sendPluginMessage(Main.plugin, "t2codealias:bungee", stream.toByteArray());
|
||||
}else {
|
||||
for(Player player : Bukkit.getOnlinePlayers()){
|
||||
player.sendPluginMessage(Main.plugin, "t2codealias:bungee", stream.toByteArray());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user