Advertisement
Exception_Prototype

Untitled

May 3rd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.     public static void checkHasClaim(Player player) throws CommandException {
  2.         if (player.hasPermission("my.perm")) {
  3.             return;
  4.         }
  5.  
  6.         ClaimManager claimManager = Warps.inst().getGriefPrevention().getClaimManager(player.getWorld());
  7.         Claim claim = claimManager.getClaimAt(new Location<>(player.getWorld(), player.getPosition()));
  8.        
  9.         if (!claim.isTrusted(player.getUniqueId())) {
  10.             throw new CommandException(TextUtils.toPluginText(TextColors.RED, "no access to the region"));
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement