示例#1
0
 @Override
 public void handleClick(PlayerInteractEvent e) {
   Arena arena = plugin.amanager.getPlayerArena(e.getPlayer().getName());
   if (arena != null) {
     arena
         .getPlayerHandler()
         .leavePlayer(e.getPlayer(), Messages.playerlefttoplayer, Messages.playerlefttoothers);
     e.setCancelled(true);
   } else {
     e.getPlayer().sendMessage("You are not in arena");
   }
 }
示例#2
0
 @Override
 public boolean handleCommand(Player player, String[] args) {
   Arena arena = plugin.amanager.getArenaByName(args[0]);
   if (arena != null) {
     if (arena.getStatusManager().isArenaEnabled()) {
       player.sendMessage("Disable arena first");
       return true;
     }
     PlayerCuboidSelection sel = selection.getPlayerSelection(player, false);
     if (sel != null) {
       arena
           .getStructureManager()
           .setArenaPoints(sel.getMinimumLocation(), sel.getMaximumLocation());
       player.sendMessage("Arena bounds set");
     } else {
       player.sendMessage("Locations are wrong or not defined");
     }
   } else {
     player.sendMessage("Arena does not exist");
   }
   return true;
 }