From 809c399a62f65a3277f70ce3d43c30aac5045434 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 28 Nov 2017 09:33:40 +1100
Subject: [PATCH] SPIGOT-3668: Missing EntityToggleGlideEvent in creative mode

---
 nms-patches/EntityHuman.patch | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch
index a8169999ba..3542492d03 100644
--- a/nms-patches/EntityHuman.patch
+++ b/nms-patches/EntityHuman.patch
@@ -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);
          }