From e911c70f855e7785f79ffb8b428a12d0e8c31fec Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jan 2020 11:30:39 +1100 Subject: [PATCH] SPIGOT-5542: Cancelling EntityToggleGlideEvent doesn't stop client from gliding --- nms-patches/EntityHuman.patch | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch index e4bbd98bf7..60b31cebac 100644 --- a/nms-patches/EntityHuman.patch +++ b/nms-patches/EntityHuman.patch @@ -416,12 +416,20 @@ } else { super.e(vec3d); } -@@ -1467,12 +1648,17 @@ +@@ -1467,12 +1648,24 @@ } 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() { @@ -434,7 +442,7 @@ } @Override -@@ -1687,26 +1873,31 @@ +@@ -1687,26 +1880,31 @@ protected void releaseShoulderEntities() { if (this.e + 20L < this.world.getTime()) {