Created
July 7, 2013 10:48
-
-
Save mooman219/5943083 to your computer and use it in GitHub Desktop.
0047-Fix-changing-inventory-in-InventoryClickEvent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 62861df12ac9541372d0b796daee501ca8ca5ca6 Mon Sep 17 00:00:00 2001 | |
From: Joe <mooman219@gmail.com> | |
Date: Sun, 7 Jul 2013 06:45:56 -0400 | |
Subject: [PATCH] Fix changing inventory in InventoryClickEvent | |
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java | |
index 2617b6e..2bacc12 100644 | |
--- a/src/main/java/net/minecraft/server/PlayerConnection.java | |
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java | |
@@ -1372,6 +1372,7 @@ public class PlayerConnection extends Connection { | |
} | |
} | |
// TODO check on updates | |
+ Container oldContainer = player.activeContainer; // Cow Add [ Fix changing inventory in InventoryClickEvent ] | |
if (packet102windowclick.shift != 5) { | |
if (click == ClickType.NUMBER_KEY) { | |
@@ -1393,6 +1394,11 @@ public class PlayerConnection extends Connection { | |
} | |
server.getPluginManager().callEvent(event); | |
+ // Cow Start [ Fix changing inventory in InventoryClickEvent ] | |
+ if(!oldContainer.equals(this.player.activeContainer)) { | |
+ event.setResult(org.bukkit.event.Event.Result.DENY); | |
+ } | |
+ // Cow End | |
switch (event.getResult()) { | |
case ALLOW: | |
-- | |
1.8.3.msysgit.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment