Fix dupe bug with fluid tank

https://github.com/aidancbrady/Mekanism/issues/3609
This commit is contained in:
clienthax 2018-12-02 19:18:57 +00:00 committed by maggi373
parent 62e48003e1
commit 7a06133f66

View file

@ -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 <= 28)
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;
}