diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/InventoryLargeChest.patch | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/InventoryLargeChest.patch')
-rw-r--r-- | nms-patches/InventoryLargeChest.patch | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/nms-patches/InventoryLargeChest.patch b/nms-patches/InventoryLargeChest.patch new file mode 100644 index 00000000..2e1b2eaa --- /dev/null +++ b/nms-patches/InventoryLargeChest.patch @@ -0,0 +1,66 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/InventoryLargeChest.java 2014-11-27 08:59:46.765421565 +1100 ++++ src/main/java/net/minecraft/server/InventoryLargeChest.java 2014-11-27 08:42:10.164850887 +1100 +@@ -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; + 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() { |