Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure inv drag is in bounds - Fixes #30 #36

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Spigot-Server-Patches/0095-Ensure-inv-drag-is-in-bounds.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 66012dd148e4fd8a3645c1388927c4260de23c8c Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <[email protected]>
Date: Sat, 20 Feb 2016 02:19:31 -0500
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 3cfaa75..3818ceb 100644
--- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java
@@ -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; //PaperSpigot- ensure drag in bounds

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.5.0