Paper/patches/server-remapped/0052-Ensure-inv-drag-is-in-bounds.patch
Mariell Hoversholm a207d14a0e
Rename all patches to correct numbering scheme
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-06-11 15:46:44 +02:00

20 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 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/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index c377a425dc3274b8aa25f94ce8f76efda2652def..72b0cfcc5aab03e14e63440c734436e9c1432111 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -238,7 +238,7 @@ public abstract class AbstractContainerMenu {
this.resetQuickCraft();
}
} else if (this.quickcraftStatus == 1) {
- Slot slot = (Slot) this.slots.get(i);
+ Slot slot = i < this.slots.size() ? this.slots.get(i) : null; // Paper - Ensure drag in bounds
itemstack1 = playerinventory.getCarried();
if (slot != null && canItemQuickReplace(slot, itemstack1, true) && slot.isAllowed(itemstack1) && (this.quickcraftType == 2 || itemstack1.getCount() > this.quickcraftSlots.size()) && this.canDragTo(slot)) {