Stuck on using methods from api

Discussion in 'Plugin Development' started by mine-care, May 28, 2014.

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

    mine-care

    Well im making a api, and i have the instance on it, i also have a testmethod:

    public int testmethod(){
    return 1;
    }
    But when i call the api from another plugin,

    Api a = new Api(); (api is the name of the api i made) // this works fine.
    But when i refet to a. it doesnt show the method in it, like it doesnt even exist...
    What should i do to make methods acessable?
    Here the whole class:
    Code:java
    1. public class GeneralAPI implements Listener {
    2.  
    3. private static GeneralAPI instance;
    4. private Plugin plugin;
    5.  
    6. public static GeneralAPI getGeneralApi() {
    7. if (instance == null) instance = new GeneralAPI();
    8. return instance;
    9. }
    10.  
    11. public void registerEvents(Listener listener, Plugin plugin) {
    12. this.plugin = plugin;
    13. Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
    14. Bukkit.getServer().getPluginManager().registerEvents(this, plugin);
    15.  
    16. }
    17.  
    18. public static int adone(){
    19. return 1;
    20. }
    21.  
    22.  
    23. }
    24.  
     
Thread Status:
Not open for further replies.

Share This Page