Search in sources :

Example 1 with PacketTravelEvent

use of crazypants.enderio.base.teleport.packet.PacketTravelEvent in project EnderIO by SleepyTrousers.

the class TravelController method doClientTeleport.

// Note: This is restricted to the current player
public boolean doClientTeleport(@Nonnull Entity entity, @Nonnull EnumHand hand, @Nonnull BlockPos bc, @Nonnull TravelSource source, int powerUse, boolean conserveMomentum) {
    TeleportEntityEvent evt = new TeleportEntityEvent(entity, source, bc, entity.dimension);
    if (MinecraftForge.EVENT_BUS.post(evt)) {
        return false;
    }
    PacketTravelEvent p = new PacketTravelEvent(evt.getTarget(), powerUse, conserveMomentum, source, hand);
    PacketHandler.INSTANCE.sendToServer(p);
    return true;
}
Also used : TeleportEntityEvent(crazypants.enderio.api.teleport.TeleportEntityEvent) PacketTravelEvent(crazypants.enderio.base.teleport.packet.PacketTravelEvent)

Aggregations

TeleportEntityEvent (crazypants.enderio.api.teleport.TeleportEntityEvent)1 PacketTravelEvent (crazypants.enderio.base.teleport.packet.PacketTravelEvent)1