Update formatting of /m

This commit is contained in:
Spencer 2018-03-07 13:53:35 -05:00 committed by Alexander Meech
parent d53829027e
commit 42a0da0d3e

View File

@ -1,5 +1,8 @@
package mineplex.mapparser.command;
import java.util.Arrays;
import java.util.stream.Collectors;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.mapparser.MapParser;
@ -24,20 +27,9 @@ public class PMCommand extends OpCommand
return true;
}
StringBuilder builder = new StringBuilder();
builder.append(player.getName()).append(": ");
for (String s : args)
{
builder.append(s).append(" ");
}
for (Player ops : getPlugin().getServer().getOnlinePlayers())
{
if (!ops.isOp())
{
continue;
}
ops.sendMessage(F.main("Message", builder.toString().trim()));
}
String message = C.cDRed + "OP " + player.getName() + " " + C.cPurple + Arrays.stream(args).collect(Collectors.joining(" ")).trim();
getPlugin().getServer().getOnlinePlayers().stream().filter(Player::isOp).forEach(p -> p.sendMessage(message));
return true;
}