Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WorldGuardClass {
- public static String wgMethod(Clipboard clipboard, int X, int Y, int Z, Player player, World AdaptedWorld) {
- BlockVector3 loc = clipboard.getDimensions();
- BlockVector3 locatios = clipboard.getOrigin(); //Not used yet
- RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
- RegionManager regions = container.get(AdaptedWorld);
- int maxX = X + (loc.getBlockX() / 2); int minX = X - (loc.getBlockX() / 2);
- int maxY = Y + (loc.getBlockY() / 2); int minY = Y - (loc.getBlockY() / 2);
- int maxZ = Z + (loc.getBlockZ() / 2); int minZ = Z - (loc.getBlockZ() / 2);
- BlockVector3 min = BlockVector3.at(minX, minY, minZ);
- BlockVector3 max = BlockVector3.at(maxX, maxY, maxZ);
- String name = player.getUniqueId().toString();
- ProtectedRegion region = new ProtectedCuboidRegion(name, min, max);
- DefaultDomain members = region.getMembers();
- members.addPlayer(UUID.fromString(name));
- regions.addRegion(region);
- for(ProtectedRegion rg : regions.getApplicableRegions(regions.getRegion(name))) {
- if(!rg.getMembers().contains(UUID.fromString(name))) {
- regions.removeRegion(name);
- return null;
- }
- }
- regions.removeRegion(name);
- return "false";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement