Java Code Examples for net.minecraft.entity.LivingEntity#hasVehicle()

The following examples show how to use net.minecraft.entity.LivingEntity#hasVehicle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Pony.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
public boolean isFlying(LivingEntity entity) {
    return !(isOnGround(entity)
            || entity.hasVehicle()
            || (entity.isClimbing() && !(entity instanceof PlayerEntity && ((PlayerEntity)entity).abilities.allowFlying))
            || entity.isSubmergedInWater()
            || entity.isSleeping());
}
 
Example 2
Source File: Pony.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
public boolean isSitting(LivingEntity entity) {
    return entity.hasVehicle()/*
            || (entity instanceof PlayerEntity
                    && entity.getVelocity().x == 0 && entity.getVelocity().z == 0
                    && !entity.isInsideWaterOrBubbleColumn() && entity.onGround && isCrouching(entity))*/;
}
 
Example 3
Source File: Pony.java    From MineLittlePony with MIT License 5 votes vote down vote up
@Override
public IPony getMountedPony(LivingEntity entity) {
    if (entity.hasVehicle() && entity.getVehicle() instanceof LivingEntity) {
        LivingEntity mount = (LivingEntity) entity.getVehicle();

        IPonyRenderContext<LivingEntity, ?> render = PonyRenderDispatcher.getInstance().getPonyRenderer(mount);

        return render == null ? null : render.getEntityPony(mount);
    }
    return null;
}