コード例 #1
0
ファイル: PermitChecker.java プロジェクト: Nekocraft/SignShop
 @EventHandler(priority = EventPriority.HIGH)
 public void onSSBuildEvent(SSCreatedEvent event) {
   if (event.isCancelled() || !event.canBeCancelled()) return;
   List<String> operation = SignShopConfig.getBlocks(event.getOperation());
   if (!hasPermit(event.getPlayer(), operation, event.getPlayer().getWorld())) {
     event.getPlayer().sendMessage(SignShopConfig.getError("need_permit", null));
     event.setCancelled(true);
   }
 }
コード例 #2
0
 @EventHandler(priority = EventPriority.HIGH)
 public void onSSBuildEvent(SSCreatedEvent event) {
   if (event.isCancelled() || !event.canBeCancelled()) return;
   List<String> operation = SignShopConfig.getBlocks(event.getOperation());
   String sOperation = event.getOperation();
   if (!operation.contains("playerIsOp")
       && !event.getPlayer().hasPerm(("SignShop.Signs." + sOperation), false)
       && !event.getPlayer().hasPerm(("SignShop.Signs.*"), false)) {
     event.getPlayer().sendMessage(SignShopConfig.getError("no_permission", null));
     event.setCancelled(true);
   }
 }