Examples of Boat


Examples of lineage2.gameserver.model.entity.boat.Boat

    double diff = activeChar.getDistance(_loc.x, _loc.y);
    int dz = Math.abs(_loc.z - activeChar.getZ());
    int h = _lastServerPosition.z - activeChar.getZ();
    if (_boatObjectId > 0)
    {
      Boat boat = BoatHolder.getInstance().getBoat(_boatObjectId);
      if ((boat != null) && (activeChar.getBoat() == boat))
      {
        activeChar.setHeading(_loc.h);
        boat.validateLocationPacket(activeChar);
      }
      activeChar.setLastClientPosition(_loc.setH(activeChar.getHeading()));
      activeChar.setLastServerPosition(activeChar.getLoc());
      return;
    }
View Full Code Here

Examples of lineage2.gameserver.model.entity.boat.Boat

    Player player = getClient().getActiveChar();
    if (player == null)
    {
      return;
    }
    Boat boat = player.getBoat();
    if ((boat != null) && (boat.getObjectId() == _boatid))
    {
      player.setInBoatPosition(_loc);
      player.setHeading(_loc.h);
      player.broadcastPacket(boat.inStopMovePacket(player));
    }
  }
View Full Code Here

Examples of lineage2.gameserver.model.entity.boat.Boat

    Player player = getClient().getActiveChar();
    if (player == null)
    {
      return;
    }
    Boat boat = BoatHolder.getInstance().getBoat(_shuttleId);
    if (boat == null)
    {
      player.sendActionFailed();
      return;
    }
    boat.moveInBoat(player, _originPos, _pos);
  }
View Full Code Here

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

Examples of org.bukkit.entity.Boat

    @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

Examples of org.bukkit.entity.Boat

    @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

Examples of org.bukkit.entity.Boat

    @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

Examples of org.bukkit.entity.Boat

    @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

Examples of org.spout.vanilla.component.entity.substance.vehicle.Boat

      } else if (facingBlock.getMaterial().equals(VanillaMaterials.AIR) && facingBlock.translate(BlockFace.BOTTOM).getMaterial() instanceof Water) {
        placePos = facingBlock.getPosition().add(.5f, 0f, .5f);
      } else {
        return false;
      }
      Boat boat = ((BoatItem) item.getMaterial()).spawnEntity(placePos);
      block.getWorld().spawnEntity(boat.getOwner());
      slot.addAmount(-1);
      return true;
    } else {
      // Try to shoot the item selected if we can't do anything else with it
      final Random rand = GenericMath.getRandom();
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.