Solved Help the constructor is undefined

Discussion in 'Plugin Development' started by SrNicks_, May 4, 2015.

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

    SrNicks_

    I've got this error in one part of my code, how to fix?
    Code:
                                        Selection sel = getWorldEdit().getSelection(p);
                                         
                                           if (sel == null) {
                                                   p.sendMessage(ChatColor.RED + "You must make a selection!");
                                                   return true;
                                           }
                                         //The error here
                                           ProtectedCuboidRegion region = new ProtectedCuboidRegion("plot_" + p.getName(),new BlockVector(sel.getNativeMinimumPoint()),new BlockVector(sel.getNativeMaximumPoint();
                                       
                                           DefaultDomain owners = new DefaultDomain();
                                           owners.addPlayer(getWorldGuard().wrapPlayer(p));
                                       
                                           region.setOwners(owners);
                                       
                                           getWorldGuard().getRegionManager(p.getWorld()).addRegion(region);
                                       
                                           p.sendMessage(ChatColor.GREEN + "Created plot with ID " + region.getId());
    
     
  2. Offline

    techboy291

    The line
    Code:
    ProtectedCuboidRegion region = new ProtectedCuboidRegion("plot_" + p.getName(),new BlockVector(sel.getNativeMinimumPoint()),new BlockVector(sel.getNativeMaximumPoint();
    is missing two parenthesis right before the semicolon.
     
  3. Offline

    MaTaMoR_

    I don't think that is his problem, i think he cut that part when he copied the code.
     
    Last edited: May 4, 2015
  4. Offline

    SrNicks_

    @techboy291 and @MaTaMoR_
    Thanks for your help
    It was my mistake the correct would be:
    Code:
     ProtectedCuboidRegion region = new ProtectedCuboidRegion("plot" + p.getName()
                                                  ,new BlockVector(sel.getNativeMaximumPoint()),
                                                  new BlockVector(sel.getNativeMinimumPoint())
                                                  );
    
     
  5. Offline

    techboy291

    @MaTaMoR_ Yeah, I don't know why I thought it was that

    I think the problem is that you're using Bukkit's BlockVector, instead of WorldEdit's, which is at com.sk89q.worldedit.BlockVector. Hope that helps :)

    Edit: Nevermind then.
     
    Last edited: May 5, 2015
Thread Status:
Not open for further replies.

Share This Page