@Override public boolean isInsideVehicle() { return base.isInsideVehicle(); }
@Override public boolean isInsideVehicle() { return e.isInsideVehicle(); }
public boolean isInsideVehicle() { return entity.isInsideVehicle(); }
/** * Check recursively for vehicles, returns null if players are vehicles, * otherwise the lowest vehicle (that has no vehicle). * * @param passenger * The passenger of vehicles. Typically the player. * @param includePassenger * If set to true, the passenger is counted as a vehicle as well * (meaning: vehicle enter, the player is not in a vehicle, test * with this set to true and the vehicle returned by the event). * @return Supposedly the vehicle that is steered. */ public Entity getLastNonPlayerVehicle(final Entity passenger, final boolean includePassenger) { Entity vehicle = includePassenger ? passenger : passenger.getVehicle(); while (vehicle != null){ if (vehicle instanceof Player){ return null; } else if (vehicle.isInsideVehicle()) { vehicle = vehicle.getVehicle(); } else { break; } } return vehicle; }