Problem/Bug Error with commandExecutor (?)

Discussion in 'Plugin Help/Development/Requests' started by CostelabrMn, Mar 3, 2017.

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

    CostelabrMn

    Waddup guys.
    Im trying to make a economy plugin, with a config file. No more Vault, no more SQLite, and that kinda databases.
    I tried to make my code with a very nice video, that i dont know if i could put him here, but that video are 3 years old D:. And my plugin get an error, that i tried, but i couldnt solved it.
    Can u guys help me?

    Error:

    http://pastebin.com/fC6zqtRS

    And my codes are:

    - "SLAPI" class:
    http://pastebin.com/n0kWW6um


    -Main class:
    http://pastebin.com/Fti7GhDz

    And the error, basicly, shows that the line of main 39:

    SLAPI.loadBalance();

    And the line of SLAPI 17:

    if(!plugin.getConfig().contains("balance")) return;

    are with problem. Pls guys, i need this code. I made him like for a hour, and it dont works. Im frustrated ;-

    Ty, and sry for my bad english XD
     
    Last edited: Mar 3, 2017
  2. Offline

    Zombie_Striker

    @CostelabrMn
    Most likely, plugin is null. Null check it and make sure it is not null.

    Also, don't use static objects. Static objects are not cleared after reloads, so you can have multiple instances of the same plugin running at the same time. Not only that, but having multiple objects (especially those that can no longer be access, because of reloads) means that there is wasted space being taken up by these objects. Don't use static fields to store your main class.
     
  3. Offline

    CostelabrMn

    @Zombie_Striker A lot of people told me that code isnt the better to be used (without sqlite and vault), do u know how can i made it better? With no problems? XD
     
  4. Offline

    Zombie_Striker

    @CostelabrMn
    Well, what part do you want to improve? Are you still having the same problem with your code? Have you done the null check?
     
Thread Status:
Not open for further replies.

Share This Page