Shift clicking in interface.

This commit is contained in:
Raoul Van den Berge
2016-03-22 18:25:22 +01:00
parent 608ac9ac50
commit 9cde93da69

View File

@@ -2,6 +2,7 @@ package refinedstorage.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import refinedstorage.container.slot.SlotOutput;
import refinedstorage.container.slot.SlotSpecimen;
import refinedstorage.tile.TileInterface;
@@ -29,4 +30,40 @@ public class ContainerInterface extends ContainerBase
addPlayerInventory(8, 136);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index)
{
ItemStack stack = null;
Slot slot = getSlot(index);
if (slot != null && slot.getHasStack())
{
stack = slot.getStack().copy();
if (index < 9)
{
if (!mergeItemStack(stack, 9, inventorySlots.size(), true))
{
return null;
}
}
else if (!mergeItemStack(stack, 0, 9, false))
{
return null;
}
if (stack.stackSize == 0)
{
slot.putStack(null);
}
else
{
slot.onSlotChanged();
}
}
return stack;
}
}