Search in sources :

Example 1 with DefaultDomain

use of com.sk89q.worldguard.domains.DefaultDomain in project LandLord by SpatiumPrinceps.

the class WorldGuardHandler method claim.

public void claim(UUID owner, String landname, World world, Location down, Location upper) {
    BlockVector vec1 = OwnedLand.locationToVec(down);
    BlockVector vec2 = OwnedLand.locationToVec(upper);
    ProtectedCuboidRegion pr = new ProtectedCuboidRegion(landname, vec1, vec2);
    DefaultDomain ownerDomain = new DefaultDomain();
    ownerDomain.addPlayer(owner);
    pr.setOwners(ownerDomain);
    // flag management
    pr = setDefaultFlags(pr, down.getChunk());
    RegionManager manager = wg.getRegionContainer().get(world);
    if (manager != null) {
        manager.addRegion(pr);
    }
}
Also used : RegionManager(com.sk89q.worldguard.protection.managers.RegionManager) ProtectedCuboidRegion(com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion) BlockVector(com.sk89q.worldedit.BlockVector) DefaultDomain(com.sk89q.worldguard.domains.DefaultDomain)

Aggregations

BlockVector (com.sk89q.worldedit.BlockVector)1 DefaultDomain (com.sk89q.worldguard.domains.DefaultDomain)1 RegionManager (com.sk89q.worldguard.protection.managers.RegionManager)1 ProtectedCuboidRegion (com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion)1