mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
More efficient handling of Party/Admin chat messages
This commit is contained in:
parent
ccd103cd88
commit
d6d1e0ffed
@ -55,12 +55,16 @@ public class ACommand implements CommandExecutor {
|
||||
return true;
|
||||
|
||||
default:
|
||||
String message = args[0];
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(args[0]);
|
||||
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
message = message + " " + args [i];
|
||||
buffer.append(" ");
|
||||
buffer.append(args[i]);
|
||||
}
|
||||
|
||||
String message = buffer.toString();
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
|
||||
|
@ -65,12 +65,16 @@ public class PCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
String message = args[0];
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(args[0]);
|
||||
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
message = message + " " + args [i];
|
||||
buffer.append(" ");
|
||||
buffer.append(args[i]);
|
||||
}
|
||||
|
||||
String message = buffer.toString();
|
||||
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(player.getName(), party.getName(), message);
|
||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
@ -98,12 +102,16 @@ public class PCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
String message = args[1];
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append(args[1]);
|
||||
|
||||
for (int i = 2; i < args.length; i++) {
|
||||
message = message + " " + args [i];
|
||||
buffer.append(" ");
|
||||
buffer.append(args[i]);
|
||||
}
|
||||
|
||||
String message = buffer.toString();
|
||||
|
||||
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent("Console", args[0], message);
|
||||
plugin.getServer().getPluginManager().callEvent(chatEvent);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user