Plugin use another plugin?

Discussion in 'Plugin Development' started by randomman159, Oct 17, 2011.

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

    randomman159

    So if i were to want to make a plugin that uses regions, how would i go about using something like the worldedit regions to define regions for my mod? Or something like that, i hope you get my point.

    Anyone have any clues? Thanks
     
  2. Are you using Eclipse?
    If you are, you should Google: Adding external JARs.

    Wait, you probably know how to do that. Because that's also how you get a reference to Bukkit's API.

    After that, you should also specify the "dependencies" (did i spell it right?) in the plugin.yml.
    Like this:

    depend: [WorldGuard]
    softdepend: [Permissions]
    Depend is a list of plugins that are required.
    Softdepend is a list of plugins that are optional.

    In Eclipse you should also be careful with the order of the JARs.
    The Java library needs to be on top. Then Bukkit, then WorldEdit, then WorldGuard for example.
    You can change the order of the JARs in a tab, next to the tab where you add JARs.

    Sorry, I'm too lazy to Google the exact instructions.

    Last thing you need to know is:
    WorldGuardPlugin worldguard = getServer().getPluginManager().getPlugin("WorldGuard");

    Eclipse will recognize WorldGuardPlugin, only if you added WorldGuard.jar via Add External JARs

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  3. Should be
    Code:
    WorldGuardPlugin worldguard = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard");
    
    basically, make sure the server has worldguard by in plugin.yml:
    Code:
    depend: WorldGuard
    
    Then look at the WorldGuard API from there ;)
     
Thread Status:
Not open for further replies.

Share This Page