//pos1 //pos2 region saving?

Discussion in 'Plugin Development' started by Sheepii, Dec 3, 2012.

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

    Sheepii

    I am looking at the worldedit javadocs and I'm lost as hell. How would you save the defined region to a custom coded plugin? I'm not trying to make a worldguard region. I'm trying to save the region seperately.
     
  2. Offline

    Malikk

    I'd make an object and store the minimum and maximum locations in it.
     
  3. Offline

    Sheepii

    I mean capturing the predefined region. I haven't even gotten that far. I don't know the function to capture the region.
     
  4. Offline

    Malikk

    Oh. Well, there's a selection object that holds all the points you need, but how you get it I'm not sure.

    You might look in world guard's source and see how he gets it in the region creation command.
     
  5. Offline

    Sheepii

    That is exactly what I was hoping to avoid doing xD
     
  6. Offline

    fireblast709

    just save 2 locations and check if a location's x, y and z are within the other 2 locations?
     
  7. Offline

    MrSnare

    I am also trying to make a plugin that does what you are asking. I need to save the region selected in an object but i don't know how to get the region
     
  8. Offline

    Gildan27

    Code:
    WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
    Selection selection = worldEditPlugin.getSelection(player);
     
    try {
        Location location1 = selection.getMaximumPoint();
        Location location2 = selection.getMinimumPoint();
    }
    catch(Exception e) {
        //Nothing was selected
    }
     
Thread Status:
Not open for further replies.

Share This Page