How Do I Implement World Edit For Cuboid Selection ?

Discussion in 'Plugin Development' started by JxAxVxAx, Jun 30, 2012.

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

    JxAxVxAx

    Hello guyz , i need help here . i wanted to use world edit's wand and define a selection , i have added world edit to my build pathway and now im stuck , im not sure which code i need to use and what i need to import , i have read the World Edit's API but still im not sure which one should i use .

    can you guyz help ??

    Anyone ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  2. Offline

    JxAxVxAx

    Bump ?
     
  3. Offline

    messageofdeath

  4. Offline

    gjossep

    That link does not give you anything, just tells you how to do it in JavaScirpt, he needs Java. I also want to know how to do this?

    Thanks
    Gjosse
     
  5. Offline

    JxAxVxAx

    Bump ?
     
  6. Offline

    Chlorek

    It's important - do you want to make regions with WorldGuard or just selection with WorldEdit?
     
  7. Offline

    bitWolfy

    I have done some googling and came across this thread: Clickity.
    The essence:


    Code:
    WorldEditPlugin worldEditPlugin = null;
    worldEditPlugin = (WorldEditPlugin) this.mainPlugin.getServer().getPluginManager().getPlugin("WorldEdit");
    Selection sel = worldEditPlugin.getSelection(plr);
    if (sel instanceof Polygonal2DSelection) {
      Polygonal2DSelection polySel = (Polygonal2DSelection) sel;
      int minY = polySel.getNativeMinimumPoint().getBlockY();
      int maxY = polySel.getNativeMaximumPoint().getBlockY();
    }
    else if (sel instanceof CuboidSelection) {
      BlockVector min = sel.getNativeMinimumPoint().toBlockVector();
      BlockVector max = sel.getNativeMaximumPoint().toBlockVector();
    }
     
  8. Offline

    JxAxVxAx

    I just want the selection of World Edit And Use It.
     
  9. Offline

    nala3

    If you just want a cuboid selection, just make the cuboid yourself. It's actually really easy
     
  10. Offline

    JxAxVxAx

    Could you tell me how ? Im new to cuboid selections .
     
  11. Offline

    Matthewenderle

    Code:
    final int radius = Main.argRadius;
                final int pX = player.getLocation().getBlockX();
                final int pY = player.getLocation().getBlockY();
                final int pZ = player.getLocation().getBlockZ();
     
     
              if(radius >=101)
              {
                  player.getPlayer().sendMessage("You must specify a number smaller than 101.");
                  player.getPlayer().sendMessage("You did a radius of " + radius);
     
              }
              else
              {
                  for (int x = (pX - radius); x <= (pX + radius); x++)
                  {
                    for(int y = (pY - radius); y <= (pY + radius); y++)
                    {
                    for(int z = (pZ - radius); z <= (pZ + radius); z++)
    I'm not doing it all for you. Export all the results to an array list.
    mlelogo.png
     
Thread Status:
Not open for further replies.

Share This Page