Create addon's for a plugin

Discussion in 'Plugin Development' started by Dablakbandit, Jan 31, 2014.

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

    Dablakbandit

    I would like to make addon's for one of my plugin, sort of like what votifier does with its Listeners. How can this be done?

    Thanks,
    Dablakabndit
     
  2. Offline

    Skyost

    Dablakbandit Simply with another plugin if you are a beginner.
    Use reflection if you are an advanced developer.
     
  3. Offline

    Dablakbandit

    Skyost
    I am not a beginner, I can't do what I want to achieve by creating another plugin. Could you give an example of reflection?

    Thanks,
    Dablakbandit
     
  4. Offline

    Garris0n

    What are you asking to do, I'm not really sure I understand...
     
  5. Offline

    Dablakbandit

    Garris0n
    Have you ever used votifier? You can download addon class's and it registers and uses them, I was wanting to do something like this.

    Thanks,
    Dablakbandit
     
  6. Offline

    Garris0n

    No, I haven't, but maybe you should check the source code of votifier to see how it's done.
     
  7. Offline

    Skyost

  8. Offline

    Dablakbandit

    Garris0n
    I am having trouble understanding how votifier does it, could you be able to help any more on this?

    Thanks,
    Dablakbandit
     
  9. Offline

    The_Doctor_123

    Dablakbandit
    All you do is reference your jar that you're wanting to create an addon for and then you have access to all of its classes.
     
  10. Offline

    Luke_Lax

    Do you mean as in an API for your plugin? Like how Vault is an economy API?
     
  11. Offline

    SuperOmegaCow

    Dablakbandit the only reason you can do that with votifier is because it has an api you can use.
     
  12. Offline

    mattrick

  13. Offline

    themuteoneS

    If I understand correctly, what you want to do is have your plugin installed and have other people put their jars in the same folder and then be loaded by your plugin (and a main function is run where API calls are made). Am I getting it or am I off by a mile?
     
  14. Offline

    xTrollxDudex

  15. Offline

    Dablakbandit

    themuteoneS
    I dont want to load other plugins i want to load other external class files the way votifier does.

    Thanks,
    Dablakbandit
     
  16. Offline

    Iaccidentally

    The what exactly is it that you do want? Your question is very vague.
     
  17. Offline

    The_Doctor_123

    Is there some problem with that..?
     
  18. Offline

    Dablakbandit

  19. Offline

    The_Doctor_123

    Huh..?
     
  20. Offline

    Dablakbandit

    The_Doctor_123
    Nvm, How do i get another jar files classes? and run them?
     
  21. Offline

    Iaccidentally

  22. Offline

    The_Doctor_123

    Reflection is a little bit of a dirty way to go about this. Takes away some of the fun. :/

    Put it in your build path, just like your Bukkit jar.
     
  23. Offline

    Iaccidentally

    You should be a little more specific about that bit
     
  24. Offline

    The_Doctor_123

    Err.. why exactly?
     
  25. Offline

    Iaccidentally

    Well, it would probably help if he would tell us what exactly he is trying to accomplish.
     
  26. Offline

    The_Doctor_123

    Regardless, he going to need to access those classes.
     
  27. Offline

    Dablakbandit

    The_Doctor_123
    What i really need is an example of a class file being opened by another plugin and executing it when it need, could you help me on this?

    Thanks,
    Dablakbandit
     
  28. Offline

    themuteoneS

  29. Offline

    Dablakbandit

    themuteoneS
    Does this load class files external from the plugin itself?
     
  30. Offline

    The_Doctor_123

    You import the classes, or reference their full name. For example, I have a plugin, it's called "Tornado." If I wanted to access the Tornado class, I can import it like so:
    Code:
    import com.domain.subdomain.Tornado.Tornado;
    Now I have full access to that class in the class I imported in. So I'll just create a new Tornado whenever someone moves..
    Code:java
    1. @EventHandler
    2. public void onPlayerMove(PlayerMoveEvent event)
    3. {
    4. new Tornado(5, 5, event.getTo(), (com.domain.subdomain.Tornado.Main) Bukkit.getPluginManager().getPlugin("Tornado"));
    5. }

    Don't try that code at home, kids..

    And remember, that code does not exist in my Tornado plugin, it's in TornadoExt. Therefore, I extended my Tornado plugin in a way.
     
Thread Status:
Not open for further replies.

Share This Page