From 6fc0a013a557164bf85e915e802b671f9a0aa706 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 9 Apr 2016 21:33:29 -0500
Subject: [PATCH] Apply the Ensure inv drag is in bounds patch properly Closes
 GH-174

---
 .../0068-Ensure-inv-drag-is-in-bounds.patch   | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/Spigot-Server-Patches/0068-Ensure-inv-drag-is-in-bounds.patch b/Spigot-Server-Patches/0068-Ensure-inv-drag-is-in-bounds.patch
index 3b52bce70b..5be7adfc67 100644
--- a/Spigot-Server-Patches/0068-Ensure-inv-drag-is-in-bounds.patch
+++ b/Spigot-Server-Patches/0068-Ensure-inv-drag-is-in-bounds.patch
@@ -1,22 +1,22 @@
-From b2f9be4f53440860fd75b41484b8347f5e23d231 Mon Sep 17 00:00:00 2001
+From f17a8ae4a73cef2e4c35c92919eff663938aac22 Mon Sep 17 00:00:00 2001
 From: Joseph Hirschfeld <joe@ibj.io>
 Date: Thu, 3 Mar 2016 02:33:53 -0600
 Subject: [PATCH] Ensure inv drag is in bounds
 
 
 diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java
-index 000b4db..e72eac4 100644
+index 000b4db..3114027 100644
 --- a/src/main/java/net/minecraft/server/Container.java
 +++ b/src/main/java/net/minecraft/server/Container.java
-@@ -110,7 +110,7 @@ public abstract class Container {
-     }
+@@ -138,7 +138,7 @@ public abstract class Container {
+                     this.d();
+                 }
+             } else if (this.g == 1) {
+-                Slot slot = (Slot) this.c.get(i);
++                Slot slot = i < this.c.size() ? this.c.get(i) : null; // Paper - Ensure drag in bounds
  
-     public ItemStack b(EntityHuman entityhuman, int i) {
--        Slot slot = (Slot) this.c.get(i);
-+        Slot slot = i < this.c.size() ? this.c.get(i) : null; // Paper - Ensure drag in bounds
- 
-         return slot != null ? slot.getItem() : null;
-     }
+                 if (slot != null && a(slot, playerinventory.getCarried(), true) && slot.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count > this.h.size() && this.b(slot)) {
+                     this.h.add(slot);
 -- 
 2.8.0