Example #1
0
 public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) {
   if (cmd.getName().equalsIgnoreCase("workbench")) {
     if (!plugin.ah.isAuthorized(cs, "rcmds.workbench")) {
       RUtils.dispNoPerms(cs);
       return true;
     }
     if (!(cs instanceof Player)) {
       cs.sendMessage(MessageColor.NEGATIVE + "This command is only available to players!");
       return true;
     }
     Player p = (Player) cs;
     p.openWorkbench(null, true);
     p.sendMessage(MessageColor.POSITIVE + "Opened a workbench for you.");
     return true;
   }
   return false;
 }
 /**
  * Open a workbench interface for the player.
  *
  * @param player player to open the workbench view for.
  * @return the workbench inventory view that was opened for the player.
  */
 public static InventoryView openWorkbench(Player player) {
   return player.openWorkbench(null, true);
 }