Example usage for net.minecraftforge.event.entity EntityMountEvent getEntityMounting

List of usage examples for net.minecraftforge.event.entity EntityMountEvent getEntityMounting

Introduction

In this page you can find the example usage for net.minecraftforge.event.entity EntityMountEvent getEntityMounting.

Prototype

public Entity getEntityMounting() 

Source Link

Usage

From source file:com.buuz135.industrial.proxy.event.FakePlayerRideEntityHandler.java

License:Open Source License

@SubscribeEvent
public void onFakePlayerRide(EntityMountEvent entityMountEvent) {
    if (entityMountEvent.getEntityMounting() instanceof IFFakePlayer)
        entityMountEvent.setCanceled(true);
}

From source file:necauqua.mods.cm.Handlers.java

License:Apache License

@SubscribeEvent
public void onEntityMount(EntityMountEvent e) { // todo this is temp, remove after riding fix (not soon)
    if (e.isMounting()
            && (getSize(e.getEntityMounting()) != 1.0F || getSize(e.getEntityBeingMounted()) != 1.0F)) {
        e.setCanceled(true);// ww  w.  j  a v  a  2 s  .  c om
    }
}