Package com.kellerkindt.scs.exceptions

Examples of com.kellerkindt.scs.exceptions.MissingOrIncorrectArgumentException


   
    if (this.args[1].toLowerCase().startsWith("rem"))
      type = Type.REMOVE_MEMBER;
   
    if (type == null)
      throw new MissingOrIncorrectArgumentException();
   
    Todo  todo  = new Todo(player, type, null, 0, args[2]);
    scs.addTodo(this.player, todo);
   
    Messaging.send(player, Term.NEXT.get());
View Full Code Here


        try {
            switch (args.length){
                case 0:
                case 1:
                case 2:
                  throw new MissingOrIncorrectArgumentException();
                 
                case 3:
                  is = Utilities.getItemStack(player, args[1]);
                    ex = Utilities.getItemStack(player, args[2]);
                    break;
                   
                case 4:
                    is = Utilities.getItemStack(player, args[1]);
                    ex = Utilities.getItemStack(player, args[2]);
                    if (args[3].equalsIgnoreCase("unlimited"))
                        unlimited = true;
                    else
                        amount = Integer.parseInt(args[3]);
                    break;
                   
                case 5:
                  is = Utilities.getItemStack(player, args[1]);
                    ex = Utilities.getItemStack(player, args[2]);
                    if (args[3].equalsIgnoreCase("unlimited"))
                        unlimited = true;
                    else
                        amount = Integer.parseInt(args[3]);
                    price  = Integer.parseInt(args[4]);
                   
                    if (price <= 0)
                      throw new MissingOrIncorrectArgumentException();
                    break;
            }
           
        } catch (Exception e) {
            throw new MissingOrIncorrectArgumentException ();
        }
   
        if (is == null || is.getTypeId() == 0 || ex == null || ex.getTypeId() == 0) {
          throw new MissingOrIncorrectArgumentException (Term.ITEM_MISSING.get()+",is="+is+",ex="+ex);
        }
       

        // if the id already exists, the ShopHandler will set a new one
        ExchangeShop  shop  = new ExchangeShop(UUID.randomUUID(), player.getName(), null, is.clone(), ex.clone());
View Full Code Here

        try {
            limit = Integer.parseInt(args[1]);
        } catch (Exception e) {}

        if (limit < 0)
            throw new MissingOrIncorrectArgumentException();
       
        Messaging.send(player, next);
        scs.addTodo(player, new Todo(player, Type.LIMIT, null, limit, null));
       
        return true;
View Full Code Here

                    price = Double.parseDouble(args[3]);
                    break;
            }
           
        } catch (Exception e) {
            throw new MissingOrIncorrectArgumentException ();
        }

        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
        BuyShop  shop  = new BuyShop(UUID.randomUUID(), player.getName(), null, is.clone());
       
View Full Code Here

TOP

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

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.