[Solved] Vector size

Discussion in 'Plugin Development' started by chriztopia, Sep 19, 2012.

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

    chriztopia

    Code:
    private void saveArea(World world,Vector origin,Vector size,File file) throws IOException, DataException{
        EditSession es = new EditSession(new BukkitWorld(world), 20000);
        CuboidClipboard cc = new CuboidClipboard(size,origin);
        cc.copy(es);
        cc.saveSchematic(file);
    }
    I want to save a schematic file but i am not sure how to figure the vector size?
     
  2. Offline

    bergerkiller

    chriztopia
    a Vector size is a width, height and depth value stored in a Vector. Basically the x/y/z size. The origin is also a Vector (or a Location), which is the offset of your cuboid in the world relative to [0, 0 , 0]. Basically, you want to make a cuboid with the blocks from the origin to (origin + size)

    Say I have a rectangle of blocks at 23/6/7 of size 4/2/2, this is what I use:
    Code:
    new CuboidClipboard(new Vector(23, 6, 7), new Location(world, 4, 2, 2));
    Of course, I do not have the documentation with me, so these are assumptions of how it would work. Origin could be a Vector too, then no World is needed.
     
  3. Offline

    chriztopia

    Thanks but I figured it out.
     
Thread Status:
Not open for further replies.

Share This Page