/** {@inheritDoc} */ @Override public boolean executeCommand(CommandSender cs, String[] args) { if (!(cs instanceof Player)) { MessageUtil.sendMessage(cs, "Sorry, only players can use this command."); return true; } if (!cs.hasPermission("trashcan.admin.setspawn")) { MessageUtil.sendMessage(cs, ChatColor.RED + "You don't have permission!"); return true; } Player player = (Player) cs; Location location = player.getLocation(); player .getWorld() .setSpawnLocation((int) location.getX(), (int) location.getY(), (int) location.getZ()); MessageUtil.sendMessage(player, ChatColor.GOLD + "New spawn has been set!"); return true; }
/** {@inheritDoc} */ @Override public boolean executeCommand(CommandSender cs, String[] args) { if (!(cs instanceof Player)) { MessageUtil.sendMessage(cs, "Sorre, only players can use this command."); return true; } if (!cs.hasPermission("trashcan.general.me")) { MessageUtil.sendMessage(cs, ChatColor.RED + "You don't have permission!"); return true; } if (args.length < 1) { return false; } else { Player player = (Player) cs; String text = ""; for (int arg = 0; arg < args.length; arg++) { text = text + " " + args[arg]; } Bukkit.broadcastMessage(ChatColor.GRAY + "* " + player.getName() + text + "."); return true; } }
/** {@inheritDoc} */ @Override public void sendUsage(CommandSender cs) { MessageUtil.sendMessage(cs, ChatColor.GRAY + "Usage: /me <is doing what?>"); }
/** {@inheritDoc} */ @Override public void sendUsage(CommandSender cs) { MessageUtil.sendMessage(cs, ChatColor.GRAY + "Usage: /setspawn"); }