papermc/Spigot-Server-Patches/0068-Ensure-inv-drag-is-in-bounds.patch

23 lines
784 B
Diff
Raw Normal View History

2016-04-02 02:08:40 +00:00
From b2f9be4f53440860fd75b41484b8347f5e23d231 Mon Sep 17 00:00:00 2001
2016-02-29 23:09:49 +00:00
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;
}
--
2016-03-31 00:50:23 +00:00
2.8.0
2016-02-29 23:09:49 +00:00