AutoMessage

Discussion in 'Plugin Development' started by NetherSky, Oct 29, 2014.

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

    NetherSky

  2. Offline

    mine-care

    First of all, ouch! That static really hurts me, please avoid its use from non util classes
    Also please post full classes so we can point the error from the stacktrace, in this case a plugin variable used in the shedule method is turning to null.
     
  3. Offline

    Funergy

    mine-care NetherSky
    IF you do everything like I said you don't even need any instances, you don't use too much statics because you use static only on methods you need to set it.
    and Please use Java friendly method names like
    loadConfig();

    set the schedule method to static and then just do in your mainclass
    Broadcaster.schedule();
    also
    remove the static from next();
    and
    set the loadConfig to static
    + a little thing that can be the problem too
    Bukkit.getScheduler().runTaskTimer(<mainclass>.getPlugin(<mainclass>.class), new Runnable() {
     
  4. Offline

    mine-care

    Specifically, you are using a static method that uses a class variable named plugin once this variable is initialized when class is instanced, static avoids instancing therefor it uses lull plugin variable
     
Thread Status:
Not open for further replies.

Share This Page