summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityMinecartAbstract.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-06-12 10:45:03 +1000
committermd_5 <git@md-5.net>2016-06-12 10:45:03 +1000
commitf642d4bcc3ee5a6e29876a213544f4502cfc863c (patch)
treef6d1328cd8a7c476b4c94e491a5f75772deb803e /nms-patches/EntityMinecartAbstract.patch
parente2ff10bdcd6edbd0b440f692dcb65c1efe41626a (diff)
downloadcraftbukkit-f642d4bcc3ee5a6e29876a213544f4502cfc863c.tar
craftbukkit-f642d4bcc3ee5a6e29876a213544f4502cfc863c.tar.gz
craftbukkit-f642d4bcc3ee5a6e29876a213544f4502cfc863c.tar.lz
craftbukkit-f642d4bcc3ee5a6e29876a213544f4502cfc863c.tar.xz
craftbukkit-f642d4bcc3ee5a6e29876a213544f4502cfc863c.zip
SPIGOT-2397: More calls to VehicleEntityCollisionEvent
Diffstat (limited to 'nms-patches/EntityMinecartAbstract.patch')
-rw-r--r--nms-patches/EntityMinecartAbstract.patch35
1 files changed, 30 insertions, 5 deletions
diff --git a/nms-patches/EntityMinecartAbstract.patch b/nms-patches/EntityMinecartAbstract.patch
index 835b05a3..70750191 100644
--- a/nms-patches/EntityMinecartAbstract.patch
+++ b/nms-patches/EntityMinecartAbstract.patch
@@ -122,7 +122,7 @@
if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) {
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
-@@ -278,6 +342,14 @@
+@@ -278,8 +342,24 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -136,8 +136,33 @@
+ // CraftBukkit end
entity.startRiding(this);
} else {
++ // CraftBukkit start
++ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity.getBukkitEntity());
++ this.world.getServer().getPluginManager().callEvent(collisionEvent);
++
++ if (collisionEvent.isCancelled()) {
++ continue;
++ }
++ // CraftBukkit end
entity.collide(this);
-@@ -301,7 +373,7 @@
+ }
+ }
+@@ -291,6 +371,14 @@
+ Entity entity1 = (Entity) iterator.next();
+
+ if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
++ // CraftBukkit start
++ VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity1.getBukkitEntity());
++ this.world.getServer().getPluginManager().callEvent(collisionEvent);
++
++ if (collisionEvent.isCancelled()) {
++ continue;
++ }
++ // CraftBukkit end
+ entity1.collide(this);
+ }
+ }
+@@ -301,7 +389,7 @@
}
protected double o() {
@@ -146,7 +171,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
-@@ -312,16 +384,20 @@
+@@ -312,16 +400,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) {
@@ -173,7 +198,7 @@
}
}
-@@ -509,7 +585,7 @@
+@@ -509,7 +601,7 @@
}
protected void r() {
@@ -182,7 +207,7 @@
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
-@@ -854,4 +930,26 @@
+@@ -854,4 +946,26 @@
}
}