Examples of VehicleDestroyEvent


Examples of org.bukkit.event.vehicle.VehicleDestroyEvent

            drops.addAll(this.entity.getBrokenDrops());
          } else {
            drops.add(new ItemStack(this.entity.getCombinedItem()));
          }
        }
        VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(this.entity.getEntity(), damager);
        if (CommonUtil.callEvent(destroyEvent).isCancelled()) {
          this.entity.setDamage(40);
          return;
        }
View Full Code Here

Examples of org.bukkit.event.vehicle.VehicleDestroyEvent

public class BoatDropsTest {

    @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);

        verify(event).setCancelled(true);
        verify(boat).remove();
View Full Code Here

Examples of org.bukkit.event.vehicle.VehicleDestroyEvent

public class BoatUncrashableTest {

    @Test
    public void testOnVehicleDestroy() {

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

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

        new Uncrashable().onVehicleDestroy(event);

        when(event.getAttacker()).thenReturn(mock(LivingEntity.class));
        new Uncrashable().onVehicleDestroy(event);

        verify(event).setCancelled(true);
        verify(boat).setVelocity(new Vector(0,0,0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.