API
redProtect comes with a simple API, you can hook into it freely, just make sure the plugin exists before attempting to do anything.
Here's a small example of how to hook into the plugin:
Plugin p = Bukkit.getPluginManager().getPlugin("redProtect"); if(p == null || !(p instanceof RedProtect)) { throw new Exception("Couldn't find required plugin: redProtect"); } else { rp = (RedProtect)p; }
From there, you can access the region manager with 'getGlobalRegionManager()'
The GlobalRegionManager has many important methods, listed below.
void saveAll(); void save(World w); Region getRegion(String name, World w); int getTotalRegionSize(String name); Set<Region> getWorldRegions(Player player, World w); Set<Region> getRegions(String player); Set<Region> getRegions(Player player); Set<Region> getRegionsNear(Player player, int radius, World w); Set<Region> getRegions(String string, World w); Region getRegion(Player player, World w); void add(Region region, World w); void remove(Region reg); boolean canBuild(Player p, Block b, World w); boolean isSurroundingRegion(Region rect, World w); boolean regionExists(Block block, World w); boolean regionExists(int x, int z, World w); Region getRegion(Location location); Set<Region> getPossibleIntersectingRegions(Region r, World w); void rename(Region rect, String name, World world); void setFlag(Region rect, int flag, boolean value, World world)
Comments