Package com.kellerkindt.scs.shops

Examples of com.kellerkindt.scs.shops.SellShop


        if (is == null || is.getTypeId() == 0) {
          throw new MissingOrIncorrectArgumentException (Term.ITEM_MISSING.get());
        }

        // if the id already exists, the ShopHandler will set a new one
        SellShop  shop  = new SellShop(UUID.randomUUID(), player.getName(), null, is.clone());
       
        shop.setAmount    (amount);
        shop.setUnlimited  (unlimited);
        shop.setPrice    (price);

        scs.msgPlayer(player, next);
        scs.addTodo(player, new Todo (player, Type.CREATE, shop, amount, null));
       
        return true;
View Full Code Here


                try {
                    price = Double.parseDouble(data);
                } catch (NumberFormatException nfe) {}
           
            // new shop
            shop = new SellShop(UUID.randomUUID(), owner, loc, is);
            shop.setUnlimited(true);
           
           
        } else if (type.equalsIgnoreCase("finite")) {
            //data = itemAmount + ";" + pricePerItem; FINITE
            if(args.length > 1)
                try {
                    amount = Integer.parseInt(args[0]);
                    price = Double.parseDouble(args[1]);
                } catch (Exception e) {}
           
            // new shop
            shop = new SellShop(UUID.randomUUID(), owner, loc, is);
           
        } else if (type.equalsIgnoreCase("exchange")) {
            amount = 0;
            //data =  Exchange-type;Exchange-data;buy-amount;exchange-amount;exchange-rate-left;exchange-rate-right
            if(args.length >= 3)
View Full Code Here

  @EventHandler (ignoreCancelled=true, priority=EventPriority.HIGHEST)
  public void onShowCasePlayerBuyEvent(ShowCasePlayerBuyEvent scpbe) {
    if (scpbe.verify()) {
      Player    player  = scpbe.getPlayer();
      int     amount  = scpbe.getQuantity();
      SellShop  shop  = scpbe.getShop();
      double    price  = shop.getPrice();
      Throwable  cause  = null;
     
 
      // fix amount
      if (amount > shop.getAmount() && !shop.isUnlimited()) {
        scpbe.setQuantity(shop.getAmount());
        amount = scpbe.getQuantity();
      }
     
      // insufficient permission
      if (!scs.canUse(player)) {
View Full Code Here

TOP

Related Classes of com.kellerkindt.scs.shops.SellShop

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.