SPIGOT-3128: Shift VehicleCreateEvent calling.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2017-03-15 20:48:47 +11:00
parent d8033d64c6
commit cedf1495bd
4 changed files with 62 additions and 68 deletions

View File

@@ -34,16 +34,7 @@
public EntityMinecartAbstract(World world) {
super(world);
this.i = true;
@@ -90,6 +110,8 @@
this.lastX = d0;
this.lastY = d1;
this.lastZ = d2;
+
+ this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
}
public double ay() {
@@ -101,6 +123,19 @@
@@ -101,6 +121,19 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else {
@@ -63,7 +54,7 @@
this.e(-this.u());
this.d(10);
this.ap();
@@ -108,6 +143,15 @@
@@ -108,6 +141,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) {
@@ -79,7 +70,7 @@
this.az();
if (flag && !this.hasCustomName()) {
this.die();
@@ -146,6 +190,14 @@
@@ -146,6 +188,14 @@
}
public void A_() {
@@ -94,7 +85,7 @@
if (this.getType() > 0) {
this.d(this.getType() - 1);
}
@@ -166,7 +218,7 @@
@@ -166,7 +216,7 @@
i = this.V();
if (this.ak) {
@@ -103,7 +94,7 @@
if (!this.isPassenger() && this.al++ >= i) {
this.al = i;
this.portalCooldown = this.aE();
@@ -266,6 +318,18 @@
@@ -266,6 +316,18 @@
}
this.setYawPitch(this.yaw, this.pitch);
@@ -122,7 +113,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));
@@ -274,8 +338,24 @@
@@ -274,8 +336,24 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -147,7 +138,7 @@
entity.collide(this);
}
}
@@ -287,6 +367,14 @@
@@ -287,6 +365,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@@ -162,7 +153,7 @@
entity1.collide(this);
}
}
@@ -297,7 +385,7 @@
@@ -297,7 +383,7 @@
}
protected double o() {
@@ -171,7 +162,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
@@ -308,16 +396,20 @@
@@ -308,16 +394,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) {
@@ -198,7 +189,7 @@
}
}
@@ -505,7 +597,7 @@
@@ -505,7 +595,7 @@
}
protected void r() {
@@ -207,7 +198,7 @@
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
@@ -780,4 +872,26 @@
@@ -780,4 +870,26 @@
}
}