Need some help with saving config

Discussion in 'Plugin Development' started by PumpMelon, Sep 14, 2016.

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

    PumpMelon

    Hey,
    I recently noticed that my Referrals plugin, on reloads, is no longer saving the int key for how many referrals a player has on reloads. I don't know why this is happening, it was working fine a bit ago.
    I should also note there is NPE's on line 46 and 72. Just haven't bothered to fix them yet because it was working still, even with those errors. (Though now its not)
    http://pastebin.com/C3eVeMZF
    Here is an example of what the config looks like
    Code:
    refers:
      pumpberry: 2
      pumpmelon: {}
    never:
      pumpmelon: never.pumpmelon
      pumpberry: never.pumpberry
    
    Thanks for your help!
     
  2. Offline

    kameronn

    Code:
    this.config.getConfigurationSection("refers").getKeys(true);
    whats the point of this? Also, check if refers is set using .isSet to prevent NPES. The reason why theres and npe on line 72 is because its calling the loadconfig method, which is where line 42s npe is. Instead of making a yaml file for the config use getConfig or this.getConfig
     
Thread Status:
Not open for further replies.

Share This Page