summaryrefslogtreecommitdiffstats
path: root/nms-patches/InventoryCraftResult.patch
blob: 3a400769fef6b108463258dcdc737e446b09d678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- a/net/minecraft/server/InventoryCraftResult.java
+++ b/net/minecraft/server/InventoryCraftResult.java
@@ -1,11 +1,44 @@
 package net.minecraft.server;
 
 import java.util.Iterator;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
 
 public class InventoryCraftResult implements IInventory {
 
     private final NonNullList<ItemStack> items;
 
+    // CraftBukkit start
+    private int maxStack = MAX_STACK;
+
+    public java.util.List<ItemStack> getContents() {
+        return this.items;
+    }
+
+    public org.bukkit.inventory.InventoryHolder getOwner() {
+        return null; // Result slots don't get an owner
+    }
+
+    // Don't need a transaction; the InventoryCrafting keeps track of it for us
+    public void onOpen(CraftHumanEntity who) {}
+    public void onClose(CraftHumanEntity who) {}
+    public java.util.List<HumanEntity> getViewers() {
+        return new java.util.ArrayList<HumanEntity>();
+    }
+
+    public void setMaxStackSize(int size) {
+        maxStack = size;
+    }
+
+    @Override
+    public Location getLocation() {
+        return null;
+    }
+    // CraftBukkit end
+
     public InventoryCraftResult() {
         this.items = NonNullList.a(1, ItemStack.a);
     }
@@ -59,7 +92,7 @@
     }
 
     public int getMaxStackSize() {
-        return 64;
+        return maxStack; // CraftBukkit
     }
 
     public void update() {}