SPIGOT-645: Fix players/entities being dismounted when the destroy event was cancelled

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot 2015-04-13 12:01:55 +01:00
parent 759c72f0aa
commit 9e0aa6efaa

View File

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/EntityMinecartAbstract.java 2015-04-13 11:54:43.295977016 +0100 --- /home/matt/mc-dev-private//net/minecraft/server/EntityMinecartAbstract.java 2015-04-13 12:01:38.387967804 +0100
+++ src/main/java/net/minecraft/server/EntityMinecartAbstract.java 2015-04-13 11:54:43.295977016 +0100 +++ src/main/java/net/minecraft/server/EntityMinecartAbstract.java 2015-04-13 12:01:38.391967804 +0100
@@ -4,6 +4,15 @@ @@ -4,6 +4,15 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -63,10 +63,10 @@
this.k(-this.r()); this.k(-this.r());
this.j(10); this.j(10);
this.ac(); this.ac();
@@ -102,6 +137,15 @@ @@ -99,6 +134,15 @@
if (this.passenger != null) { boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
this.passenger.mount((Entity) null);
} if (flag || this.getDamage() > 40.0F) {
+ // CraftBukkit start + // CraftBukkit start
+ VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger); + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger);
+ this.world.getServer().getPluginManager().callEvent(destroyEvent); + this.world.getServer().getPluginManager().callEvent(destroyEvent);
@ -76,9 +76,9 @@
+ return true; + return true;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (this.passenger != null) {
if (flag && !this.hasCustomName()) { this.passenger.mount((Entity) null);
this.die(); }
@@ -140,6 +184,14 @@ @@ -140,6 +184,14 @@
} }