summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGJ <gjmcferrin@gmail.com>2014-02-10 12:12:39 -0500
committerTravis Watkins <amaranth@ubuntu.com>2014-04-18 10:01:31 -0500
commita4fe7cd3c4a4f04d67c12e0addb20c2acd146273 (patch)
tree782b3c578d531cf07c751aef3876ed0fd282b183 /src
parent9c251595d4f3a3096ff2410d1ef2e35da47e9ecf (diff)
downloadcraftbukkit-a4fe7cd3c4a4f04d67c12e0addb20c2acd146273.tar
craftbukkit-a4fe7cd3c4a4f04d67c12e0addb20c2acd146273.tar.gz
craftbukkit-a4fe7cd3c4a4f04d67c12e0addb20c2acd146273.tar.lz
craftbukkit-a4fe7cd3c4a4f04d67c12e0addb20c2acd146273.tar.xz
craftbukkit-a4fe7cd3c4a4f04d67c12e0addb20c2acd146273.zip
[Bleeding] Return correct player SlotType. Fixes BUKKIT-3188
Previously, the SlotType for the last 4 slots in a player's inventory returned QUICKBAR when it should have returned SlotType.CONTAINER. This updates the code for determining slot type to return the proper value.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
index 8925e601..ae47a0ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
@@ -127,8 +127,12 @@ public class CraftInventoryView extends InventoryView {
} else {
if (slot == -999) {
type = SlotType.OUTSIDE;
- } else if (inventory.getType() == InventoryType.CRAFTING && slot < 9) {
- type = SlotType.ARMOR;
+ } else if (inventory.getType() == InventoryType.CRAFTING) {
+ if (slot < 9) {
+ type = SlotType.ARMOR;
+ } else if (slot > 35) {
+ type = SlotType.QUICKBAR;
+ }
} else if (slot >= (inventory.countSlots() - 9)) {
type = SlotType.QUICKBAR;
}