From 1f6003e722d1b6a97520944cdbf658aa742e96c1 Mon Sep 17 00:00:00 2001 From: Andrew Hill Date: Fri, 5 Oct 2012 19:16:44 +1000 Subject: [PATCH] fix filter shift-click The gui should not direct stacks moved by shift-click to the filter area, just to the inventory area. --- .../builders/gui/ContainerFiller.java | 21 +++++++++++++++++++ .../core/gui/BuildCraftContainer.java | 3 +++ 2 files changed, 24 insertions(+) diff --git a/common/buildcraft/builders/gui/ContainerFiller.java b/common/buildcraft/builders/gui/ContainerFiller.java index 734e0c3c..c094bd26 100644 --- a/common/buildcraft/builders/gui/ContainerFiller.java +++ b/common/buildcraft/builders/gui/ContainerFiller.java @@ -12,6 +12,7 @@ package buildcraft.builders.gui; import buildcraft.core.gui.BuildCraftContainer; import net.minecraft.src.EntityPlayer; import net.minecraft.src.IInventory; +import net.minecraft.src.ItemStack; import net.minecraft.src.Slot; public class ContainerFiller extends BuildCraftContainer { @@ -52,5 +53,25 @@ public class ContainerFiller extends BuildCraftContainer { public boolean canInteractWith(EntityPlayer entityplayer) { return fillerInventory.isUseableByPlayer(entityplayer); } + + @Override + public ItemStack transferStackInSlot(int i) { + ItemStack itemstack = null; + Slot slot = (Slot) inventorySlots.get(i); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (i < getInventorySize()) { + if (!mergeItemStack(itemstack1, getInventorySize(), inventorySlots.size(), true)) + return null; + } else if (!mergeItemStack(itemstack1, 9, getInventorySize(), false)) + return null; + if (itemstack1.stackSize == 0) + slot.putStack(null); + else + slot.onSlotChanged(); + } + return itemstack; + } } \ No newline at end of file diff --git a/common/buildcraft/core/gui/BuildCraftContainer.java b/common/buildcraft/core/gui/BuildCraftContainer.java index 11f629d4..82ceccfa 100644 --- a/common/buildcraft/core/gui/BuildCraftContainer.java +++ b/common/buildcraft/core/gui/BuildCraftContainer.java @@ -41,4 +41,7 @@ public abstract class BuildCraftContainer extends Container { return itemstack; } + public int getInventorySize(){ + return inventorySize; + } }