Package org.bukkit

Examples of org.bukkit.Location


    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -1000, 64, 1000);

    // Act
    Location existingCorner2 = new Location(worldMock, 0, 64, 0);
    volume.setCornerTwo(existingCorner2); // corner 2 already set
    volume.setNorthwest(nw);
  }
View Full Code Here


    when(worldMock.getMaxHeight()).thenReturn(256);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, 0, 64, 0);
    volume.setCornerOne(existingCorner1); // corner 1 already set
    volume.setNorthwest(nw);

    // Assert
    // first corner shouldn't move
    assertEquals(existingCorner1, volume.getCornerOne());

    Location nwMax = new Location(worldMock, -64, 256, 64);
    assertEquals(nwMax, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, -64);

    // Act
    Location existingCorner1 = new Location(worldMock, 0, 64, 0);
    volume.setCornerOne(existingCorner1); // corner 1 already set
    volume.setNorthwest(nw);
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, 64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, 0, 64, 0);
    volume.setCornerOne(existingCorner1); // corner 1 already set
    volume.setNorthwest(nw);
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, -32, 32, 32); // nw
    volume.setCornerOne(existingCorner1); // corner 1 already set
    Location existingCorner2 = new Location(worldMock, 32, 96, -32); // se
    volume.setCornerTwo(existingCorner2); // corner 2 already set
    volume.setNorthwest(nw);

    // Assert
    // first corner should move but not along y
    Location movedOne = new Location(worldMock, -64, 32, 64);
    assertEquals(movedOne, volume.getCornerOne());

    // second corner shouldn't move
    assertEquals(existingCorner2, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, 32, 32, -32); // nw
    volume.setCornerOne(existingCorner1); // corner 1 already set
    Location existingCorner2 = new Location(worldMock, -32, 96, 32); // se
    volume.setCornerTwo(existingCorner2); // corner 2 already set
    volume.setNorthwest(nw);

    // Assert
    // first corner shouldn't move
    assertEquals(existingCorner1, volume.getCornerOne());

    // second corner should move but not along y
    Location movedTwo = new Location(worldMock, -64, 96, 64);
    assertEquals(movedTwo, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, -32, 32, -32); // ne
    volume.setCornerOne(existingCorner1); // corner 1 already set
    Location existingCorner2 = new Location(worldMock, 32, 96, 32); // sw
    volume.setCornerTwo(existingCorner2); // corner 2 already set
    volume.setNorthwest(nw);

    // Assert
    // first corner should move along x but not along y or z
    Location movedOne = new Location(worldMock, -64, 32, -32);
    assertEquals(movedOne, volume.getCornerOne());

    // second corner should move along z but not along x or y
    Location movedTwo = new Location(worldMock, 32, 96, 64);
    assertEquals(movedTwo, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location nw = new Location(worldMock, -64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, 32, 32, 32); // sw
    volume.setCornerOne(existingCorner1); // corner 1 already set
    Location existingCorner2 = new Location(worldMock, -32, 96, -32); // ne
    volume.setCornerTwo(existingCorner2); // corner 2 already set
    volume.setNorthwest(nw);

    // Assert
    // first corner should move along z but not along x or y
    Location movedOne = new Location(worldMock, 32, 32, 64);
    assertEquals(movedOne, volume.getCornerOne());

    // second corner should move along x but not along y or z
    Location movedTwo = new Location(worldMock, -64, 96, -32);
    assertEquals(movedTwo, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location se = new Location(worldMock, 0, 64, 0);

    // Act
    volume.setSoutheast(se);

    // Assert
    Location movedOne = new Location(worldMock, 0, 0, 0);
    assertEquals(movedOne, volume.getCornerTwo());
  }
View Full Code Here

    World worldMock = mock(World.class);
    Warzone zoneMock = mock(Warzone.class);
    when(zoneMock.getTeams()).thenReturn(new ArrayList<Team>());
    when(zoneMock.getMonuments()).thenReturn(new ArrayList<Monument>());
    ZoneVolume volume = new ZoneVolume("test", worldMock, zoneMock);
    Location se = new Location(worldMock, 64, 64, 64);

    // Act
    Location existingCorner1 = new Location(worldMock, 0, 64, 0);
    volume.setCornerOne(existingCorner1); // corner 1 already set
    volume.setSoutheast(se);
  }
View Full Code Here

TOP

Related Classes of org.bukkit.Location

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.