summaryrefslogtreecommitdiffstats
path: root/nms-patches/Slot.patch
blob: 5814e07a101de9d0d0c98c9c6373c5d5d0a736a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- a/net/minecraft/server/Slot.java
+++ b/net/minecraft/server/Slot.java
@@ -2,7 +2,7 @@
 
 public class Slot {
 
-    private final int index;
+    public final int index; // CraftBukkit - public
     public final IInventory inventory;
     public int rawSlotIndex;
     public int f;
@@ -45,6 +45,9 @@
     }
 
     public boolean hasItem() {
+        if (getItem() != null && getItem().count == 0) {
+            set(null);
+        }
         return this.getItem() != null;
     }