Fix dupe bug with fluid tank
https://github.com/aidancbrady/Mekanism/issues/3609
This commit is contained in:
parent
611627519d
commit
adb09e43ea
1 changed files with 16 additions and 9 deletions
|
@ -61,42 +61,49 @@ public class ContainerFluidTank extends Container
|
||||||
|
|
||||||
if(currentSlot != null && currentSlot.getHasStack())
|
if(currentSlot != null && currentSlot.getHasStack())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int inputSlot = 0;
|
||||||
|
int outputSlot = 1;
|
||||||
|
int firstGenericInvSlot = 2;
|
||||||
|
int firstHotbarSlot = 29;
|
||||||
|
int lastHotbarSlot = 38;
|
||||||
|
|
||||||
ItemStack slotStack = currentSlot.getStack();
|
ItemStack slotStack = currentSlot.getStack();
|
||||||
stack = slotStack.copy();
|
stack = slotStack.copy();
|
||||||
|
|
||||||
if(FluidContainerRegistry.isEmptyContainer(slotStack) || FluidContainerRegistry.isFilledContainer(slotStack))
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
|
if(!mergeItemStack(slotStack, firstGenericInvSlot, lastHotbarSlot, true))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true))
|
if(!mergeItemStack(slotStack, firstGenericInvSlot, lastHotbarSlot, true))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue