SPIGOT-3668: Missing EntityToggleGlideEvent in creative mode

This commit is contained in:
md_5 2017-11-28 09:33:40 +11:00
parent f46ccd7637
commit 809c399a62

View File

@ -359,7 +359,20 @@
}
}
@@ -1540,13 +1701,17 @@
@@ -1256,7 +1417,11 @@
this.motY = d3 * 0.6D;
this.aR = f3;
this.fallDistance = 0.0F;
- this.setFlag(7, false);
+ // CraftBukkit start
+ if (getFlag(7) && !org.bukkit.craftbukkit.event.CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) {
+ this.setFlag(7, false);
+ }
+ // CraftBukkit end
} else {
super.a(f, f1, f2);
}
@@ -1540,13 +1705,17 @@
}
protected void releaseShoulderEntities() {
@ -382,7 +395,7 @@
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
Entity entity = EntityTypes.a(nbttagcompound, this.world);
@@ -1555,9 +1720,10 @@
@@ -1555,9 +1724,10 @@
}
entity.setPosition(this.locX, this.locY + 0.699999988079071D, this.locZ);
@ -394,7 +407,7 @@
}
public abstract boolean isSpectator();
@@ -1759,7 +1925,7 @@
@@ -1759,7 +1929,7 @@
return entitymonster.c(this.a);
}