示例#1
0
 @EventHandler(priority = EventPriority.HIGH)
 public void onSSPreTransactionEvent(SSPreTransactionEvent event) {
   if (event.isCancelled() || !event.canBeCancelled()) return;
   List<String> operation = SignShopConfig.getBlocks(event.getOperation());
   if (!hasPermit(event.getOwner(), operation, event.getPlayer().getWorld())) {
     event.getPlayer().sendMessage(SignShopConfig.getError("no_permit_owner", null));
     event.setCancelled(true);
   }
 }
示例#2
0
 @EventHandler(priority = EventPriority.HIGH)
 public void onSSPreTransactionEvent(SSPreTransactionEvent event) {
   if (event.isCancelled() || !event.canBeCancelled()) return;
   String sOperation = event.getOperation();
   SignShopPlayer ssPlayer = event.getPlayer();
   if (ssPlayer.hasPerm(("SignShop.DenyUse." + sOperation), false)
       && !ssPlayer.hasPerm(("SignShop.Signs." + sOperation), false)
       && !ssPlayer.hasPerm(("SignShop.Admin." + sOperation), true)) {
     ssPlayer.sendMessage(SignShopConfig.getError("no_permission_use", null));
     event.setCancelled(true);
   }
 }