aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch
new file mode 100644
index 0000000000..0d3f513d34
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/CompoundContainer.java.patch
@@ -0,0 +1,57 @@
+--- a/net/minecraft/world/CompoundContainer.java
++++ b/net/minecraft/world/CompoundContainer.java
+@@ -3,17 +3,42 @@
+ import net.minecraft.world.entity.player.Player;
+ import net.minecraft.world.item.ItemStack;
+
++// CraftBukkit start
++import java.util.ArrayList;
++import java.util.List;
++import org.bukkit.Location;
++
++import org.bukkit.craftbukkit.entity.CraftHumanEntity;
++import org.bukkit.entity.HumanEntity;
++// CraftBukkit end
++
+ public class CompoundContainer implements Container {
+
+ private final Container container1;
+ private final Container container2;
+
+- public CompoundContainer(Container container, Container container1) {
+- this.container1 = container;
+- this.container2 = container1;
++ // CraftBukkit start - add fields and methods
++ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
++
++ public List<ItemStack> getContents() {
++ List<ItemStack> result = new ArrayList<ItemStack>(this.getContainerSize());
++ for (int i = 0; i < this.getContainerSize(); i++) {
++ result.add(this.getItem(i));
++ }
++ return result;
+ }
+
+ @Override
++ public Location getLocation() {
++ return container1.getLocation(); // TODO: right?
++ }
++ // CraftBukkit end
++
++ public CompoundContainer(Container container1, Container container2) {
++ this.container1 = container1;
++ this.container2 = container2;
++ }
++
+ @Override
+ public int getContainerSize() {
+ return this.container1.getContainerSize() + this.container2.getContainerSize();
+@@ -61,7 +105,7 @@
+ @Override
+ @Override
+ public int getMaxStackSize() {
+- return this.container1.getMaxStackSize();
++ return Math.min(this.container1.getMaxStackSize(), this.container2.getMaxStackSize()); // CraftBukkit - check both sides
+ }
+
+ @Override