Solved Help hooking into my own plugin

Discussion in 'Plugin Development' started by Koenn, Dec 27, 2015.

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

    Koenn

    I have 2 plugins. I want to get some information from plugin 1 in plugin 2. Here's the code I have:
    Plugin 1:
    Code:
    public static Integer getLevel(UUID uuid){
        return level.get(uuid);
    }
    Plugin 2:
    Code:
    Integer level = plugin1.getLevel(uuid);
    The main class from plugin 1 is called plugin1 and in the External Libraries of plugin 2 I put plugin 1, but for some reason its not working
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Koenn It is a static method, you can just call it in a static way.
     
  3. Offline

    Koenn

    What do you mean by static way?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Koenn It is a static method. You can call it from everywhere.
     
  5. Offline

    Koenn

    Even from a different plugin?
     
  6. Offline

    Mrs. bwfctower

    Well you can call it from everywhere because it's public. You can call it without an instance of the class because it's static.
     
    teej107 likes this.
  7. Offline

    Koenn

  8. Offline

    Mrs. bwfctower

    @Koenn Try refreshing your IDE.
     
  9. Offline

    Koenn

    Oh I think i fixed it... I accedently added the project to the library, not the jar file.
     
Thread Status:
Not open for further replies.

Share This Page