Solved How do I hook into Towny?

Discussion in 'Plugin Development' started by phondeux, Dec 19, 2012.

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

    phondeux

    I have multiple worlds and I want my custom gate code to stop if the gate on the far side will be created in a Town in which the player doesn't have rights to create.

    I remember there was a tutorial to hook into other plugins to use what they export but I can't find it. :(
     
  2. Offline

    fireblast709

    Long story short:
    • add the plugin as dependency in your plugin.yml
      Code:
      depends: [Towny]
    • add the plugin as a library, just like you add Bukkit.jar
    • do whatever you need to do. One way is getting an instance of the plugin with
      Code:java
      1. Bukkit.getPluginManager().getPlugin("Towny");
      and cast it to whatever they use as main class. This instance (make sure it is not null) is used for any further method calls
     
    phondeux likes this.
  3. Offline

    phondeux

    Thank you!
     
Thread Status:
Not open for further replies.

Share This Page