Hey I have a new question again ^^ I want to integrate WorldGuard in my Plugin that I can change or "manipulate" the owner or members of the regions. Also I want to read out the size (width, length, height) of the regions. I read the following api instructions, but this doesn't helps me ... http://wiki.sk89q.com/wiki/WorldGuard/Regions/API Is this in any way possible? I am happy about every solution! Greetings, Hanno
try importing the worlguard plugin to your project, and see hwat methodes there are on the main class
found an example how to get the main worldguard plugin: Code:java public static WorldGuardPlugin getWorldGuard(JavaPlugin plugin){ Plugin wPlugin = plugin.getServer().getPluginManager().getPlugin("WorldGuard"); if ((wPlugin == null) || (!(wPlugin instanceof WorldGuardPlugin))) { return null; } return (WorldGuardPlugin) wPlugin;}
I copied your code example into my main class and tried to call "getWorldGuard(this)." A list of all commands i got you see on the image I uploaded
Yes you are right, but i tried the following Code: getWorldGuard(this).getGlobalRegionManager(). getWorldGuard(this).getRegionManager(World world). And then i got the same but lessier methods
I don't really get what you're saying... what are the methods that those 2 methods provide ? Also, don't call getWorldGuard() all the time, store its pointer. EDIT: here's an example from the very link you posted: Code: WorldGuardPlugin worldGuard = getWorldGuard(); Vector pt = toVector(block); // This also takes a location LocalPlayer localPlayer = worldGuard.wrapPlayer(player); RegionManager regionManager = worldGuard.getRegionManager(world); ApplicableRegionSet set = regionManager.getApplicableRegions(pt); return set.canBuild(localPlayer); So, I'm unsure if you really understand Java or not, but there are alot of methods there that you can use.
I hope it is allowed posting links of picture upload sites, the pictures take very much space of the thread ^^ What do you mean with "pointer"? Maybe something like this? Code: WorldGuardPlugin wgp = getWorldGuard(this); This I got if I used "getWorldGuard(this).getRegionManager(World world);" (I got lessier methods but some of them are the same) And this I got if I used "getWorldGuard(this).getGlobalRegionManager()." (more lessier methods than in the picture before, but they are the same) I don't found a method, which I can use for my plan
Okay this code seems to be very interesting for my plan, but how I can remove a player from owner or / and member of a region ?
Okay, I took a good look at this code, but i found no way to CHANGE owners and members. I think with this code I can only get informations about the regions or the player, but I want to change owners and members of regions.... Is there no way or am I too stupid for that?
just guaessing, it might be WorldGuardPlugin worldGuard = getWorldGuard(); Vector pt = toVector(block); // This also takes a location LocalPlayer localPlayer = worldGuard.wrapPlayer(player); RegionManager regionManager = worldGuard.getRegionManager(world); ApplicableRegionSet set = regionManager.getApplicableRegions(pt); set.addOwner(localPlayer); // or it might be set.addOwner(localPlaye.getNamer);
How about look at the available methods there ? And also look at the available methods for worldGuard.getRegionManager(world).
http://forums.bukkit.org/threads/tu...uard-in-your-plugin-using-it-in-events.64779/ ^ My little tutorial on the basics of WorldGuard :3