World edit and world guard problem

Discussion in 'Plugin Development' started by gamerover98, Nov 19, 2014.

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

    gamerover98

    hello boys, I've a problem with worldEdit area.

    I want select cuboid area about the player:
    Code:
            //Import worldEdit with main class!
            Selection sel = MClans.instance.getWorldEdit().getSelection(p);
              //set max and min point
              sel.getNativeMaximumPoint().setX(p.getLocation().getX() + 16);
              sel.getNativeMaximumPoint().setY(p.getLocation().getY() + 250);
              sel.getNativeMaximumPoint().setZ(p.getLocation().getZ() + 16);
              sel.getNativeMinimumPoint().setX(p.getLocation().getX() - 16);
              sel.getNativeMinimumPoint().setY(p.getLocation().getY() - 250);
              sel.getNativeMinimumPoint().setZ(p.getLocation().getZ() - 16);
    

    Create worldguard region:

    Code:java
    1. try {
    2.  
    3. ProtectedCuboidRegion region = new ProtectedCuboidRegion(
    4.  
    5. "empire_" + p.getName(),
    6. new BlockVector(sel.getNativeMaximumPoint()),
    7. new BlockVector(sel.getNativeMinimumPoint())
    8. );
    9.  
    10. DefaultDomain owners = new DefaultDomain();
    11. owners.addPlayer(MClans.instance.getWorldGuard().wrapPlayer(p));
    12.  
    13. region.setOwners(owners);
    14.  
    15. MClans.instance.getWorldGuard().getRegionManager(p.getWorld()).addRegion(region);
    16.  
    17. } catch (MaxChangedBlocksException e) {
    18. // TODO Auto-generated catch block
    19. e.printStackTrace();
    20. }
    21.  


    The code doesn't get error but this is the log:
    http://pastebin.com/UaDeLJyQ

    sorry for my english :(
     
  2. Offline

    ColonelHedgehog

    You might have better luck getting this problem solved by going to the creator of WorldEdit/WorldGuard's forums: http://forum.enginehub.org/
     
  3. Offline

    gamerover98

    ah lol ty!
     
Thread Status:
Not open for further replies.

Share This Page