From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 27 Feb 2016 10:07:58 +1100 Subject: [PATCH] Entity Mount and Dismount Events diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { } } // CraftBukkit end + // Spigot start + org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(entity.getBukkitEntity(), this.getBukkitEntity()); + Bukkit.getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } + // Spigot end if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bt() instanceof EntityHuman)) { this.passengers.add(0, entity); } else { @@ -0,0 +0,0 @@ public abstract class Entity implements ICommandListener { } } // CraftBukkit end + Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity())); // Spigot this.passengers.remove(entity); entity.j = 60; } --