Java Code Examples for net.minecraft.entity.EntityLiving#getBukkitEntity()

The following examples show how to use net.minecraft.entity.EntityLiving#getBukkitEntity() . 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: CraftEventFactory.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
/**
 * EntityTameEvent
 */
public static EntityTameEvent callEntityTameEvent(EntityLiving entity, EntityPlayer tamer) {
    org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
    org.bukkit.entity.AnimalTamer bukkitTamer = (tamer != null ? tamer.getBukkitEntity() : null);
    CraftServer craftServer = (CraftServer) bukkitEntity.getServer();

    entity.persistenceRequired = true;

    EntityTameEvent event = new EntityTameEvent((LivingEntity) bukkitEntity, bukkitTamer);
    craftServer.getPluginManager().callEvent(event);
    return event;
}
 
Example 2
Source File: CraftEventFactory.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(EntityLiving entity, EntityPlayer player) {
    PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity());
    entity.world.getServer().getPluginManager().callEvent(event);
    return event;
}
 
Example 3
Source File: CraftEventFactory.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public static PlayerLeashEntityEvent callPlayerLeashEntityEvent(EntityLiving entity, Entity leashHolder, EntityPlayer player) {
    PlayerLeashEntityEvent event = new PlayerLeashEntityEvent(entity.getBukkitEntity(), leashHolder.getBukkitEntity(), (Player) player.getBukkitEntity());
    entity.world.getServer().getPluginManager().callEvent(event);
    return event;
}