Package org.bukkit.entity

Examples of org.bukkit.entity.Vehicle


            Minecart m = (Minecart) e;
            if (!plugin.getBlockSafety().canSpawnCartSafely(m)) {
                return null;
            }
        } else if (e instanceof Vehicle) {
            Vehicle v = (Vehicle) e;
            if (!plugin.getBlockSafety().canSpawnVehicleSafely(v)) {
                return null;
            }
        }
        Location safeLocation = this.getSafeLocation(l);
View Full Code Here


            Minecart m = (Minecart) e;
            if (!this.bs.canSpawnCartSafely(m)) {
                return null;
            }
        } else if (e instanceof Vehicle) {
            Vehicle v = (Vehicle) e;
            if (!this.bs.canSpawnVehicleSafely(v)) {
                return null;
            }
        }
        Location safeLocation = this.getSafeLocation(l);
View Full Code Here

   */
  @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
  private void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
    if (event.getPlayer().getVehicle() == event.getRightClicked() && event.getRightClicked() instanceof Vehicle) {
      // Call a player exit event
      final Vehicle vehicle = (Vehicle) event.getRightClicked();
      event.setCancelled(CommonUtil.callEvent(new VehicleExitEvent(vehicle, event.getPlayer())).isCancelled());
    }
  }
View Full Code Here

      moveDx = handle.locX - oldLocX;
      moveDy = handle.locY - oldLocY;
      moveDz = handle.locZ - oldLocZ;
      if (entity.getEntity() instanceof Vehicle && entity.isMovementImpaired()) {
        Vehicle vehicle = (Vehicle) entity.getEntity();
        org.bukkit.block.Block block = entity.getWorld().getBlockAt(entity.loc.x.block(), MathUtil.floor(handle.locY - (double) handle.height), entity.loc.z.block());
        if (oldDx > dx) {
          block = block.getRelative(BlockFace.EAST);
        } else if (oldDx < dx) {
          block = block.getRelative(BlockFace.WEST);
View Full Code Here

TOP

Related Classes of org.bukkit.entity.Vehicle

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.