Shift clicking in interface.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user