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

This commit is contained in:
Thinkofdeath 2015-04-13 12:01:55 +01:00
parent 643486f469
commit a5b7881dbe

View File

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