mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
SPIGOT-5542: Cancelling EntityToggleGlideEvent doesn't stop client from gliding
This commit is contained in:
parent
596b0b2d07
commit
e911c70f85
1 changed files with 12 additions and 4 deletions
|
@ -416,12 +416,20 @@
|
||||||
} else {
|
} else {
|
||||||
super.e(vec3d);
|
super.e(vec3d);
|
||||||
}
|
}
|
||||||
@@ -1467,12 +1648,17 @@
|
@@ -1467,12 +1648,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startGliding() {
|
public void startGliding() {
|
||||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callToggleGlideEvent(this, true).isCancelled()) // CraftBukkit
|
- this.setFlag(7, true);
|
||||||
this.setFlag(7, true);
|
+ // CraftBukkit start
|
||||||
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callToggleGlideEvent(this, true).isCancelled()) {
|
||||||
|
+ this.setFlag(7, true);
|
||||||
|
+ } else {
|
||||||
|
+ // SPIGOT-5542: must toggle like below
|
||||||
|
+ this.setFlag(7, true);
|
||||||
|
+ this.setFlag(7, false);
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopGliding() {
|
public void stopGliding() {
|
||||||
|
@ -434,7 +442,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1687,26 +1873,31 @@
|
@@ -1687,26 +1880,31 @@
|
||||||
|
|
||||||
protected void releaseShoulderEntities() {
|
protected void releaseShoulderEntities() {
|
||||||
if (this.e + 20L < this.world.getTime()) {
|
if (this.e + 20L < this.world.getTime()) {
|
||||||
|
|
Loading…
Reference in a new issue