* @param cmd to execute
* @param cause of command, can be null
*/
public void setCommand(String cmd, Cause<?> cause) {
if (cause != null && cause.getSource() instanceof CommandSource) {
CommandSource cmdSource = (CommandSource) cause.getSource();
String prefix = VanillaPlugin.getInstance().getPrefix();
if (!cmdSource.hasPermission("vanilla.commandblock." + cmd.split(" ")[0])) {
cmdSource.sendMessage(prefix + ChatStyle.RED + " You don't have permission to do that.");
return;
}
cmdSource.sendMessage(prefix + ChatStyle.WHITE + "CommandDescription set: " + ChatStyle.GREEN + cmd);
}
if (!cmd.startsWith("/")) {
cmd = "say " + cmd;
} else {