Archiviert
13
0

SPIGOT-1584: Entity mount / dismount events are backwards

Dieser Commit ist enthalten in:
md_5 2016-03-02 06:41:39 +11:00 committet von Zach Brown
Ursprung ea8cad9f21
Commit f68b7307db

Datei anzeigen

@ -1,11 +1,11 @@
From cf164be65d7c2d5d3a0456d6d78e87375a0ab6e1 Mon Sep 17 00:00:00 2001
From a18925d947c5794b7c6434eb628095e91feeb368 Mon Sep 17 00:00:00 2001
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
index 1817e6d..e6aa217 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 {
@ -13,7 +13,7 @@ index 1817e6d..1eec160 100644
}
// CraftBukkit end
+ // Spigot start
+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(this.getBukkitEntity(), entity.getBukkitEntity());
+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(entity.getBukkitEntity(), this.getBukkitEntity());
+ Bukkit.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
@ -26,7 +26,7 @@ index 1817e6d..1eec160 100644
}
}
// CraftBukkit end
+ Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ) ); // Spigot
+ Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity())); // Spigot
this.passengers.remove(entity);
entity.j = 60;
}