diff --git a/src/main/java/mekanism/common/inventory/container/ContainerFluidTank.java b/src/main/java/mekanism/common/inventory/container/ContainerFluidTank.java index 6e8652ccb..e1bcb12fd 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerFluidTank.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerFluidTank.java @@ -52,7 +52,7 @@ public class ContainerFluidTank extends Container { return tileEntity.isUseableByPlayer(entityplayer); } - + @Override public ItemStack transferStackInSlot(EntityPlayer player, int slotID) { @@ -61,42 +61,49 @@ public class ContainerFluidTank extends Container if(currentSlot != null && currentSlot.getHasStack()) { + + int inputSlot = 0; + int outputSlot = 1; + int firstGenericInvSlot = 2; + int firstHotbarSlot = 29; + int lastHotbarSlot = 38; + ItemStack slotStack = currentSlot.getStack(); stack = slotStack.copy(); if(FluidContainerRegistry.isEmptyContainer(slotStack) || FluidContainerRegistry.isFilledContainer(slotStack)) { - if(slotID != 0 && slotID != 1) + if (slotID != inputSlot && slotID != outputSlot) { - if(!mergeItemStack(slotStack, 0, 1, false)) + if(!mergeItemStack(slotStack, inputSlot, outputSlot, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, firstGenericInvSlot, lastHotbarSlot, true)) { return null; } } } else { - if(slotID >= 2 && slotID <= 8) + if(slotID >= firstGenericInvSlot && slotID < firstHotbarSlot) { - if(!mergeItemStack(slotStack, 29, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, firstHotbarSlot, lastHotbarSlot, false)) { return null; } } - else if(slotID > 28) + else if(slotID >= firstHotbarSlot && slotID <= lastHotbarSlot) { - if(!mergeItemStack(slotStack, 2, 28, false)) + if(!mergeItemStack(slotStack, firstGenericInvSlot, firstHotbarSlot, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, firstGenericInvSlot, lastHotbarSlot, true)) { return null; }