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

@@ -31,15 +31,7 @@
public EntityBoat(World world) {
super(world);
this.f = new float[2];
@@ -48,6 +65,7 @@
this.lastX = d0;
this.lastY = d1;
this.lastZ = d2;
+ this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
}
protected boolean playStepSound() {
@@ -95,6 +113,19 @@
@@ -95,6 +112,19 @@
if (damagesource instanceof EntityDamageSourceIndirect && damagesource.getEntity() != null && this.w(damagesource.getEntity())) {
return false;
} else {
@@ -59,7 +51,7 @@
this.d(-this.q());
this.b(10);
this.setDamage(this.n() + f * 10.0F);
@@ -102,6 +133,15 @@
@@ -102,6 +132,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.n() > 40.0F) {
@@ -75,7 +67,7 @@
if (!flag && this.world.getGameRules().getBoolean("doEntityDrops")) {
this.a(this.j(), 1, 0.0F);
}
@@ -119,9 +159,25 @@
@@ -119,9 +158,25 @@
public void collide(Entity entity) {
if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().b < this.getBoundingBox().e) {
@@ -101,7 +93,7 @@
super.collide(entity);
}
@@ -158,6 +214,7 @@
@@ -158,6 +213,7 @@
return this.getDirection().e();
}
@@ -109,7 +101,7 @@
public void A_() {
this.aH = this.aG;
this.aG = this.t();
@@ -178,7 +235,6 @@
@@ -178,7 +234,6 @@
if (this.n() > 0.0F) {
this.setDamage(this.n() - 1.0F);
}
@@ -117,7 +109,7 @@
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
@@ -202,6 +258,22 @@
@@ -202,6 +257,22 @@
this.motZ = 0.0D;
}
@@ -140,7 +132,7 @@
for (int i = 0; i <= 1; ++i) {
if (this.a(i)) {
this.f[i] = (float) ((double) this.f[i] + 0.01D);
@@ -593,6 +665,11 @@
@@ -593,6 +664,11 @@
this.e(this.fallDistance, 1.0F);
if (!this.world.isClientSide && !this.dead) {
@@ -152,7 +144,7 @@
this.die();
if (this.world.getGameRules().getBoolean("doEntityDrops")) {
int i;
@@ -606,6 +683,7 @@
@@ -606,6 +682,7 @@
}
}
}