3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 03:20:07 +01:00

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> From: md_5 <git@md-5.net>
Date: Sat, 27 Feb 2016 10:07:58 +1100 Date: Sat, 27 Feb 2016 10:07:58 +1100
Subject: [PATCH] Entity Mount and Dismount Events 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 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 --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/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 { @@ -1679,6 +1679,13 @@ public abstract class Entity implements ICommandListener {
@ -13,7 +13,7 @@ index 1817e6d..1eec160 100644
} }
// CraftBukkit end // CraftBukkit end
+ // Spigot start + // 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); + Bukkit.getPluginManager().callEvent(event);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return; + return;
@ -26,7 +26,7 @@ index 1817e6d..1eec160 100644
} }
} }
// CraftBukkit end // 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); this.passengers.remove(entity);
entity.j = 60; entity.j = 60;
} }