mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 19:56:52 +01:00
69 lines
2.1 KiB
Diff
69 lines
2.1 KiB
Diff
--- /home/matt/mc-dev-private//net/minecraft/server/InventoryLargeChest.java 2015-02-26 22:40:22.779608137 +0000
|
|
+++ src/main/java/net/minecraft/server/InventoryLargeChest.java 2015-02-26 22:40:22.779608137 +0000
|
|
@@ -1,10 +1,54 @@
|
|
package net.minecraft.server;
|
|
|
|
+// CraftBukkit start
|
|
+import java.util.List;
|
|
+
|
|
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
|
+import org.bukkit.entity.HumanEntity;
|
|
+// CraftBukkit end
|
|
+
|
|
public class InventoryLargeChest implements ITileInventory {
|
|
|
|
private String a;
|
|
- private ITileInventory left;
|
|
- private ITileInventory right;
|
|
+ public ITileInventory left;
|
|
+ public ITileInventory right;
|
|
+
|
|
+ // CraftBukkit start - add fields and methods
|
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
|
+
|
|
+ public ItemStack[] getContents() {
|
|
+ ItemStack[] result = new ItemStack[this.getSize()];
|
|
+ for (int i = 0; i < result.length; i++) {
|
|
+ result[i] = this.getItem(i);
|
|
+ }
|
|
+ return result;
|
|
+ }
|
|
+
|
|
+ public void onOpen(CraftHumanEntity who) {
|
|
+ this.left.onOpen(who);
|
|
+ this.right.onOpen(who);
|
|
+ transaction.add(who);
|
|
+ }
|
|
+
|
|
+ public void onClose(CraftHumanEntity who) {
|
|
+ this.left.onClose(who);
|
|
+ this.right.onClose(who);
|
|
+ transaction.remove(who);
|
|
+ }
|
|
+
|
|
+ public List<HumanEntity> getViewers() {
|
|
+ return transaction;
|
|
+ }
|
|
+
|
|
+ public org.bukkit.inventory.InventoryHolder getOwner() {
|
|
+ return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here
|
|
+ }
|
|
+
|
|
+ public void setMaxStackSize(int size) {
|
|
+ this.left.setMaxStackSize(size);
|
|
+ this.right.setMaxStackSize(size);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
public InventoryLargeChest(String s, ITileInventory itileinventory, ITileInventory itileinventory1) {
|
|
this.a = s;
|
|
@@ -68,7 +112,7 @@
|
|
}
|
|
|
|
public int getMaxStackSize() {
|
|
- return this.left.getMaxStackSize();
|
|
+ return Math.min(this.left.getMaxStackSize(), this.right.getMaxStackSize()); // CraftBukkit - check both sides
|
|
}
|
|
|
|
public void update() {
|