コード例 #1
0
 /** {@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;
 }
コード例 #2
0
ファイル: MeCommand.java プロジェクト: codename-B/CommandBin
 /** {@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;
   }
 }
コード例 #3
0
ファイル: MeCommand.java プロジェクト: codename-B/CommandBin
 /** {@inheritDoc} */
 @Override
 public void sendUsage(CommandSender cs) {
   MessageUtil.sendMessage(cs, ChatColor.GRAY + "Usage: /me <is doing what?>");
 }
コード例 #4
0
 /** {@inheritDoc} */
 @Override
 public void sendUsage(CommandSender cs) {
   MessageUtil.sendMessage(cs, ChatColor.GRAY + "Usage: /setspawn");
 }