mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 14:33:56 +01:00
SPIGOT-645: Fix players/entities being dismounted when the destroy event was cancelled
This commit is contained in:
parent
643486f469
commit
a5b7881dbe
@ -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 @@
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user