Package com.kellerkindt.scs.exceptions

Examples of com.kellerkindt.scs.exceptions.InsufficientPermissionException


     
      Throwable  cause    = null;
     
      if (!scs.canManage(player, shop, true)) {
        // not enough permissions
        cause = new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION_REM_SHOWCASE.get());
       
      } else {
        // add the items from the shop
        notAdded = shop.getAmount() - ItemStackUtilities.addToInventory(player.getInventory(), shop.getItemStack(), shop.getAmount());
       
View Full Code Here


  @Override
  @EventHandler (ignoreCancelled=true, priority=EventPriority.HIGHEST)
  public void onShowCaseMemberRemoveEvent(ShowCaseMemberRemoveEvent scmre) {
    if (scmre.verify() && !scs.canManage(scmre.getPlayer(), scmre.getShop(), true)) {
      scmre.setCancelled(true);
      scmre.setCause(new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION_REM_MEMBER.get()));
    }
  }
View Full Code Here

  @Override
  @EventHandler (ignoreCancelled=true, priority=EventPriority.HIGHEST)
  public void onShowCaseOwnerSetEvent(ShowCaseOwnerSetEvent scose) {
    if (scose.verify() && !scs.isAdmin(scose.getPlayer())) {
      scose.setCancelled(true);
      scose.setCause(new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION_SET_OWNER.get()));
    }
  }
View Full Code Here

  @Override
  @EventHandler (ignoreCancelled=true, priority=EventPriority.HIGHEST)
  public void onShowCasePriceSetEvent(ShowCasePriceSetEvent scpse) {
    if (scpse.verify() && !scs.canManage(scpse.getPlayer(), scpse.getShop(), false)) {
      scpse.setCancelled(true);
      scpse.setCause(new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION_SET_PRICE.get()));
    }
  }
View Full Code Here

        amount = scpbe.getQuantity();
      }
     
      // insufficient permission
      if (!scs.canUse(player)) {
        cause = new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION.get());
       
      }
     
      // insufficient money
      else if (!scs.getBalanceHandler().hasEnough(player.getName(), amount*price)) {
View Full Code Here

        amount = scpse.getQuantity();
      }
     
      // insufficient permission
      if (!scs.canUse(player)) {
        cause = new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION.get());
       
      }
     
      // insufficient money
      else if (!scs.getBalanceHandler().hasEnough(shop.getOwner(), amount*price)) {
View Full Code Here

  @Override
  @EventHandler (ignoreCancelled=true, priority=EventPriority.HIGHEST)
  public void onShowCasePlayerExchangeEvent(ShowCasePlayerExchangeEvent scpee) {
    if (scpee.verify() && !scs.canUse(scpee.getPlayer())) {
      scpee.setCancelled(true);
      scpee.setCause(new InsufficientPermissionException(Term.ERROR_INSUFFICIENT_PERMISSION.get()));
    }
  }
View Full Code Here

  public boolean execute() throws MissingOrIncorrectArgumentException, InsufficientPermissionException {
    if (errorCheck())
      return true;
   
    if(Properties.blacklistedWorlds.contains(player.getWorld().getName()))
            throw new InsufficientPermissionException("`rYou are not allowed to create a showcase in this world."); //msg: blacklistError
   
    //Default values:
        int     amount     = 0;
        boolean    unlimited  = false;
        int     price     = 1;
View Full Code Here

    public boolean execute() throws MissingOrIncorrectArgumentException, InsufficientPermissionException {
        if(errorCheck())
            return true;

        if(Properties.blacklistedWorlds.contains(player.getWorld().getName()))
            throw new InsufficientPermissionException("`rYou are not allowed to create a showcase in this world."); //msg: blacklistError
       
        //Default values:
        int     amount     = 0;
        boolean    unlimited  = false;
        double     price     = 1.0;
View Full Code Here

TOP

Related Classes of com.kellerkindt.scs.exceptions.InsufficientPermissionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.