added shift click functionality

This commit is contained in:
brandon3055 committed 2014-06-20 18:18:06 +10:00
1 parent 36046ff754
commit adcc9f0ce2
3 files changed
+91 -8

No files matched your search

@@ -4,6 +4,7 @@ import draconicevolution.client.interfaces.SlotItemValid;
import draconicevolution.common.tileentities.TileGrinder;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -36,8 +37,34 @@ public class ContainerGrinder extends Container {
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
public ItemStack transferStackInSlot(EntityPlayer player, int i)
{
Slot slot = getSlot(i);
if (slot != null && slot.getHasStack())
{
ItemStack stack = slot.getStack();
ItemStack result = stack.copy();
if (i >= 36){
if (!mergeItemStack(stack, 0, 36, false)){
return null;
}
}else if (TileGrinder.getItemBurnTime(stack) == 0 || !mergeItemStack(stack, 36, 36 + tile.getSizeInventory(), false)){
return null;
}
if (stack.stackSize == 0) {
slot.putStack(null);
}else{
slot.onSlotChanged();
}
slot.onPickupFromSlot(player, stack);
return result;
}
return null;
}