Package org.bukkit.entity

Examples of org.bukkit.entity.Boat


        if(!EventUtil.passesFilter(event)) return;

        if (!(event.getVehicle() instanceof Boat)) return;

        if (event.getAttacker() == null) {
            Boat boat = (Boat) event.getVehicle();
            boat.getLocation().getWorld().dropItemNaturally(boat.getLocation(), new ItemStack(Material.BOAT));
            boat.remove();
            event.setCancelled(true);
        }
    }
View Full Code Here


    @SuppressWarnings("serial")
    @Test
    public void testOnVehicleExit() {

        VehicleExitEvent event = mock(VehicleExitEvent.class);
        Boat boat = mock(Boat.class);

        Server server = mock(Server.class);
        when(server.getName()).thenReturn("Mock");
        when(server.getVersion()).thenReturn("MockVer");
        when(server.getBukkitVersion()).thenReturn("MockVer");
        when(server.getLogger()).thenReturn(Logger.getLogger(Logger.GLOBAL_LOGGER_NAME));
        when(server.getScheduler()).thenReturn(mock(BukkitScheduler.class));

        Bukkit.setServer(server);

        Location location = mock(Location.class);

        World world = mock(World.class);
        when(location.getWorld()).thenReturn(world);

        when(boat.getLocation()).thenReturn(location);
        when(boat.isValid()).thenReturn(true);

        when(event.getVehicle()).thenReturn(boat);

        ExitRemover rem = new ExitRemover();
        rem.onVehicleExit(event);
View Full Code Here

    @Test
    public void testOnVehicleDestroy() {

        VehicleDestroyEvent event = mock(VehicleDestroyEvent.class);
        Boat boat = mock(Boat.class);
        Location loc = mock(Location.class);
        World world = mock(World.class);

        when(loc.getWorld()).thenReturn(world);
        when(boat.getLocation()).thenReturn(loc);

        when(event.getVehicle()).thenReturn(boat);
        when(event.getAttacker()).thenReturn(null);

        new Drops().onVehicleDestroy(event);
View Full Code Here

    @Test
    public void testOnVehicleCreate() {

        VehicleCreateEvent event = mock(VehicleCreateEvent.class);
        Boat boat = mock(Boat.class);

        when(event.getVehicle()).thenReturn(boat);

        new LandBoats().onVehicleCreate(event);
View Full Code Here

    @Test
    public void testOnVehicleDestroy() {

        VehicleDestroyEvent event = mock(VehicleDestroyEvent.class);
        Boat boat = mock(Boat.class);

        when(event.getVehicle()).thenReturn(boat);

        new Uncrashable().onVehicleDestroy(event);
View Full Code Here

TOP

Related Classes of org.bukkit.entity.Boat

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.