Paper/CraftBukkit-Patches/0045-Anvil-Exploit-Fix.patch

23 lines
971 B
Diff

From ca336d318f06163f3aeeb47fa2ae28c31a459c7d Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 29 Mar 2013 13:56:36 +1000
Subject: [PATCH] Anvil Exploit Fix
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java
index a1d930c..540b2dc 100644
--- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java
@@ -337,7 +337,7 @@ public abstract class Container {
}
} else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
slot2 = (Slot) this.c.get(i);
- if (slot2 != null && slot2.d()) {
+ if (slot2 != null && slot2.d() && slot2.a(entityhuman)) { // Spigot
itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
slot2.a(entityhuman, itemstack1);
entityhuman.drop(itemstack1);
--
1.8.2.1