Fixed EntityTame event.

By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
CraftBukkit/Spigot 2011-06-12 23:38:35 -04:00
parent 9bf573516b
commit c8b101b9de

View file

@ -238,7 +238,7 @@ public class CraftEventFactory {
*/
public static EntityTameEvent callEntityTameEvent(EntityLiving entity, EntityHuman tamer) {
org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
org.bukkit.entity.AnimalTamer bukkitTamer = (AnimalTamer) tamer.getBukkitEntity();
org.bukkit.entity.AnimalTamer bukkitTamer = (tamer != null ? (AnimalTamer) tamer.getBukkitEntity() : null);
CraftServer craftServer = (CraftServer) bukkitEntity.getServer();
EntityTameEvent event = new EntityTameEvent(bukkitEntity, bukkitTamer);