Help on register Scheduler in Main class!

Discussion in 'Plugin Development' started by Deltateamsoldier, Aug 22, 2014.

Thread Status:
Not open for further replies.
  1. hey Community,
    I am writing a plugin at the moment that is for the support on a server. If a player makes /support, all supporters will get a message that this one player needs support. That works fine but I want to make that they can use the command only every .. minutes/hours ... I made that with an arraylist but I dont know how to import the arrylist into your main class, that I can register it in the main.. Pls dont say that you need the code because you dont.. Only say me how I can register an arraylist in from another class into the main class : )
  2. Offline


    Make the arraylist "static" then in your main classname.arraylist name and done
  3. Offline


    Global collections are prone to memory leaks
  4. Offline


    Never had isues with it
  5. Offline


    Try reloading your server hundreds of times, it should become apparent quite soon
  6. Offline


    nope never happend it has now like 500 reloads still to issues with it xd

    i clear the arraylists when i reload thats maybe why its not breaking xd
  7. Offline


    mechoriet Static does not exist for your convenience. Aside that, it is bad design (no encapsulation, tight coupling). Rather rely on injection instead (constructor injection being a very common form on Bukkit or setter injection. Google it!)
    Zupsub likes this.
  8. Offline


    To register it use:
    1. ArrayList<Player> cooldown = new ArrayList<Player>();
    Deltateamsoldier likes this.
Thread Status:
Not open for further replies.

Share This Page