Please help config/integerList giving true instead of list

Discussion in 'Plugin Development' started by dbaum102, May 5, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    dbaum102

    Please help config/integerList giving true instead of list: Code:
    Code:
    ItemStack x = p.getItemInHand();
                                        ArrayList<Integer> id = (ArrayList<Integer>) this.getConfig().getIntegerList("shop."+args[0].toLowerCase()+".idList");
                                        id.add(x.getTypeId());
                                        ArrayList<Integer> amount = (ArrayList<Integer>) this.getConfig().getIntegerList("shop."+args[0].toLowerCase()+".amountList");
                                        amount.add(x.getAmount());
                                        ArrayList<Integer> price = (ArrayList<Integer>) this.getConfig().getIntegerList("shop."+args[0].toLowerCase()+".priceList");
                                        price.add(x.getAmount());
                                        this.getConfig().set("shop."+args[0].toLowerCase()+".idList", id);
                                        this.getConfig().set("shop."+args[0].toLowerCase()+".amountList", amount);
                                        this.getConfig().set("shop."+args[0].toLowerCase()+".priceList", price);
                                        this.saveConfig();
                                        return true;
    config.yml after run:
    Code:
    shop:
      spawner:
        idList: true
        amountList: true
        priceList: true
    

    Why is it giving true instead of {...}
     
  2. Offline

    DoggyCode™

    Is this a method, then it is returning true because you are telling it to:
     
  3. Offline

    dbaum102

    its in the on Commands i dont see why it would return true in the config

    How is this giving me a nullpointerexception?
    Code:
    ItemStack temp = new ItemStack(Material.getMaterial(temps.get(i)),temps2.get(i));
                ItemMeta m = temp.getItemMeta();
                ArrayList<String> s = new ArrayList<>();
                s.add("$"+price.get(i));
                m.setLore(s);
                temp.setItemMeta(m);
                x.addItem(temp);
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 7, 2016
Thread Status:
Not open for further replies.

Share This Page