diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-06-09 04:03:15 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-09 04:03:15 -0400 |
commit | b0714775e1d153a04475970601ccc67f768079df (patch) | |
tree | 2b71d09ca839d1a76b70e0f216251b5b857f6107 /src/main/java/org | |
parent | 0c24f86a0974207d224cc873104fd14188e726d3 (diff) | |
download | craftbukkit-b0714775e1d153a04475970601ccc67f768079df.tar craftbukkit-b0714775e1d153a04475970601ccc67f768079df.tar.gz craftbukkit-b0714775e1d153a04475970601ccc67f768079df.tar.lz craftbukkit-b0714775e1d153a04475970601ccc67f768079df.tar.xz craftbukkit-b0714775e1d153a04475970601ccc67f768079df.zip |
Added EntityTame event. Thanks halvors!
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 4f879b98..ee2d4dbb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -31,6 +31,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.CreatureType; import org.bukkit.entity.Player; import org.bukkit.event.Event.Type; @@ -38,6 +39,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.EntityTameEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.event.player.PlayerBucketFillEvent; import org.bukkit.event.player.PlayerEvent; @@ -228,4 +230,17 @@ public class CraftEventFactory { craftServer.getPluginManager().callEvent(event); return event; } + + /** + * EntityTameEvent + */ + public static EntityTameEvent callEntityTameEvent(EntityLiving entity, EntityHuman tamer) { + org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity(); + org.bukkit.entity.AnimalTamer bukkitTamer = (AnimalTamer) tamer.getBukkitEntity(); + CraftServer craftServer = (CraftServer) bukkitEntity.getServer(); + + EntityTameEvent event = new EntityTameEvent(bukkitEntity, bukkitTamer); + craftServer.getPluginManager().callEvent(event); + return event; + } } |