Paper/Spigot-Server-Patches/0070-Ensure-inv-drag-is-in-bounds.patch
2016-03-30 20:50:23 -04:00

23 lines
784 B
Diff

From 1299d70ab8048f1fb255ff46acce134a8c1f75ee 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
--- 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 {
}
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;
}
--
2.8.0