summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2013-03-16 10:27:46 -0500
committerTravis Watkins <amaranth@ubuntu.com>2013-03-16 10:28:12 -0500
commita76a5bd36f052470d2f4112f7de9286dabbc2f12 (patch)
tree3de3d790dece22c333aa271dbfa1d7c3ce5b5a56 /src
parent9a38f2022a39e0f687146e4d6eb5dc292fdb4ff7 (diff)
downloadcraftbukkit-a76a5bd36f052470d2f4112f7de9286dabbc2f12.tar
craftbukkit-a76a5bd36f052470d2f4112f7de9286dabbc2f12.tar.gz
craftbukkit-a76a5bd36f052470d2f4112f7de9286dabbc2f12.tar.lz
craftbukkit-a76a5bd36f052470d2f4112f7de9286dabbc2f12.tar.xz
craftbukkit-a76a5bd36f052470d2f4112f7de9286dabbc2f12.zip
Ignore invalid inventory slots. Fixes BUKKIT-3737
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/PlayerConnection.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index aeca924f..10fedeb4 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1159,6 +1159,11 @@ public class PlayerConnection extends Connection {
if (this.player.activeContainer.windowId == packet102windowclick.a && this.player.activeContainer.c(this.player)) {
// CraftBukkit start - fire InventoryClickEvent
+ if (packet102windowclick.slot == -1) {
+ // Vanilla doesn't do anything with this, neither should we
+ return;
+ }
+
InventoryView inventory = this.player.activeContainer.getBukkitView();
SlotType type = CraftInventoryView.getSlotType(inventory, packet102windowclick.slot);
@@ -1223,8 +1228,9 @@ public class PlayerConnection extends Connection {
this.player.a(this.player.activeContainer, arraylist);
// CraftBukkit start - send a Set Slot to update the crafting result slot
- if(type == SlotType.RESULT && itemstack != null)
+ if(type == SlotType.RESULT && itemstack != null) {
this.player.playerConnection.sendPacket((Packet) (new Packet103SetSlot(this.player.activeContainer.windowId, 0, itemstack)));
+ }
// CraftBukkit end
}
}