shift clicking in wireless transmitter + textures

This commit is contained in:
Raoul Van den Berge
2015-12-24 17:21:55 +01:00
parent 35bacfc90b
commit b939b80ae6
8 changed files with 90 additions and 4 deletions

View File

@@ -2,6 +2,8 @@ package storagecraft.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import storagecraft.StorageCraftItems;
import storagecraft.container.slot.SlotItemFilter;
import storagecraft.container.slot.SlotOutput;
@@ -13,10 +15,46 @@ public class ContainerWirelessTransmitter extends ContainerBase
{
super(player);
addPlayerInventory(8, 55);
addSlotToContainer(new SlotItemFilter(wirelessTransmitter, 0, 8, 20, Items.ender_pearl));
addSlotToContainer(new SlotItemFilter(wirelessTransmitter, 1, 101, 20, StorageCraftItems.WIRELESS_GRID));
addSlotToContainer(new SlotOutput(wirelessTransmitter, 2, 152, 20));
addPlayerInventory(8, 55);
}
@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 < 3)
{
if (!mergeItemStack(stack, 3, inventorySlots.size(), true))
{
return null;
}
}
else if (!mergeItemStack(stack, 0, 3, false))
{
return null;
}
if (stack.stackSize == 0)
{
slot.putStack(null);
}
else
{
slot.onSlotChanged();
}
}
return stack;
}
}