2016-03-01 00:23:45 +00:00
|
|
|
From cf164be65d7c2d5d3a0456d6d78e87375a0ab6e1 Mon Sep 17 00:00:00 2001
|
2016-02-29 21:33:06 +00:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
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 1817e6d..1eec160 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
@@ -1679,6 +1679,13 @@ public abstract class Entity implements ICommandListener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
+ // Spigot start
|
|
|
|
+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(this.getBukkitEntity(), entity.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 {
|
|
|
|
@@ -1708,6 +1715,7 @@ public abstract class Entity implements ICommandListener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
+ Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ) ); // Spigot
|
|
|
|
this.passengers.remove(entity);
|
|
|
|
entity.j = 60;
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.5.0
|
|
|
|
|