Package com.sk89q.worldedit.world

Examples of com.sk89q.worldedit.world.World


     *
     * @return the delegate region
     */
    protected Region getRegion() {
        LocalSession session = Request.request().getSession();
        World world = Request.request().getWorld();

        if (session != null && world != null) {
            try {
                return session.getSelection(world);
            } catch (IncompleteRegionException ignored) {
View Full Code Here


        assertEquals(TEST_VALUE, location.getBlockZ());
    }

    @Test
    public void testSetZ() throws Exception {
        World world = mock(World.class);
        Location location1 = new Location(world, new Vector());
        Location location2 = location1.setZ(TEST_VALUE);
        assertEquals(0, location1.getZ(), EPSILON);
        assertEquals(0, location2.getX(), EPSILON);
        assertEquals(0, location2.getY(), EPSILON);
View Full Code Here

    private static final int TEST_VALUE = 10;
    private static final double EPSILON = 0.0001;

    @Test
    public void testGetWorld() throws Exception {
        World world = mock(World.class);
        Location location = new Location(world);
        assertEquals(world, location.getExtent());
    }
View Full Code Here

        assertEquals(world, location.getExtent());
    }

    @Test
    public void testSetWorld() throws Exception {
        World world1 = mock(World.class);
        World world2 = mock(World.class);
        Location location1 = new Location(world1);
        Location location2 = location1.setExtent(world2);
        assertEquals(world1, location1.getExtent());
        assertEquals(world2, location2.getExtent());
    }
View Full Code Here

        assertEquals(world2, location2.getExtent());
    }

    @Test
    public void testToVector() throws Exception {
        World world = mock(World.class);
        Vector position = new Vector(1, 1, 1);
        Location location = new Location(world, position);
        assertEquals(position, location.toVector());
    }
View Full Code Here

        assertEquals(position, location.toVector());
    }

    @Test
    public void testGetX() throws Exception {
        World world = mock(World.class);
        Location location = new Location(world, new Vector(TEST_VALUE, 0, 0));
        assertEquals(TEST_VALUE, location.getX(), EPSILON);
    }
View Full Code Here

        assertEquals(TEST_VALUE, location.getX(), EPSILON);
    }

    @Test
    public void testGetBlockX() throws Exception {
        World world = mock(World.class);
        Location location = new Location(world, new Vector(TEST_VALUE, 0, 0));
        assertEquals(TEST_VALUE, location.getBlockX());
    }
View Full Code Here

        assertEquals(TEST_VALUE, location.getBlockX());
    }

    @Test
    public void testSetX() throws Exception {
        World world = mock(World.class);
        Location location1 = new Location(world, new Vector());
        Location location2 = location1.setX(TEST_VALUE);
        assertEquals(0, location1.getX(), EPSILON);
        assertEquals(TEST_VALUE, location2.getX(), EPSILON);
        assertEquals(0, location2.getY(), EPSILON);
View Full Code Here

        assertEquals(0, location2.getZ(), EPSILON);
    }

    @Test
    public void testGetY() throws Exception {
        World world = mock(World.class);
        Location location = new Location(world, new Vector(0, TEST_VALUE, 0));
        assertEquals(TEST_VALUE, location.getY(), EPSILON);
    }
View Full Code Here

        assertEquals(TEST_VALUE, location.getY(), EPSILON);
    }

    @Test
    public void testGetBlockY() throws Exception {
        World world = mock(World.class);
        Location location = new Location(world, new Vector(0, TEST_VALUE, 0));
        assertEquals(TEST_VALUE, location.getBlockY());
    }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.world.World

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.