Regions API - elRegions

Discussion in 'Resources' started by WinSock, Jul 6, 2011.

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

    WinSock

    I figured i would post this in plugin development resources also. I have made a API/plugin that takes care of all of the heavy lifting of regions and even provides events for when a player enters/leaves a region. Add it as a dependency and add it as a referenced library(Or use maven and include it as a maven dependency).

    http://forums.bukkit.org/threads/gen-dev-elregions-v1-0-simple-region-api-creation-953.23998/

    Example of getting the plugin
    Code:java
    1.  
    2. elRegionsPlugin elRegions = (elRegionsPlugin) this.getServer().getPluginManager().getPlugin("elRegions");
    3.  
    4. if (elRegions == null) {
    5. log.info("ERROR: Could not load elRegions!");
    6. this.setEnabled(false);
    7. return;
    8. }
    9.  


    Example of getting regions that a location is in(Builds off of above example):
    Code:java
    1.  
    2. RegionManager manager = elRegions.getRegionManager(Bukkit.getServer().getWorld("world"));
    3. Set<Region> regions = manager.getRegions(location);
    4. for(Region r : regions) {
    5. System.out.println("Location is contained in region: " + r.getName());
    6. }
    7.  
     
  2. what plugin is this for? :O
     
  3. Offline

    WinSock

    The one that is linked in my post and my sig (elRegions)
     
  4. Oh...:p
     
Thread Status:
Not open for further replies.

Share This Page