Merge pull request #333 from AartBluestoke/filler301patch_2

fix filter shift-click
This commit is contained in:
CovertJaguar 2012-10-05 11:22:27 -07:00
commit 7bd14cf8fa
2 changed files with 24 additions and 0 deletions

View file

@ -12,6 +12,7 @@ package buildcraft.builders.gui;
import buildcraft.core.gui.BuildCraftContainer; import buildcraft.core.gui.BuildCraftContainer;
import net.minecraft.src.EntityPlayer; import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory; import net.minecraft.src.IInventory;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Slot; import net.minecraft.src.Slot;
public class ContainerFiller extends BuildCraftContainer { public class ContainerFiller extends BuildCraftContainer {
@ -52,5 +53,25 @@ public class ContainerFiller extends BuildCraftContainer {
public boolean canInteractWith(EntityPlayer entityplayer) { public boolean canInteractWith(EntityPlayer entityplayer) {
return fillerInventory.isUseableByPlayer(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;
}
} }

View file

@ -41,4 +41,7 @@ public abstract class BuildCraftContainer extends Container {
return itemstack; return itemstack;
} }
public int getInventorySize(){
return inventorySize;
}
} }