Merge pull request #53 from Thorfusion/49-bug-drum-duplication-trough-tanks

fix fluidtank duplication with fluidstacks Thorfusion#49
This commit is contained in:
maggi373 authored and GitHub committed 2022-11-21 23:40:36 +01:00
commit e076dbe0ad
6 files changed
+85 -12

No files matched your search

@@ -410,4 +410,19 @@ public class TileEntityBoilerCasing extends TileEntityMultiblock<SynchronizedBoi
{
return LangUtils.localize("gui.thermoelectricBoiler");
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
@Override
public void setInventorySlotContents(int slotID, ItemStack itemstack)
{
inventory[slotID] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
}
@@ -322,4 +322,9 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
structure.editMode = mode;
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
}
@@ -600,4 +600,19 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
break;
}
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
@Override
public void setInventorySlotContents(int slotID, ItemStack itemstack)
{
inventory[slotID] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
}
@@ -276,25 +276,18 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
{
if(slotID == 0)
{
if(itemstack.getItem() instanceof IFluidContainerItem)
{
if (itemstack.getItem() instanceof IFluidContainerItem) {
return true;
}
else if(FluidContainerRegistry.isFilledContainer(itemstack))
{
} else if (FluidContainerRegistry.isFilledContainer(itemstack)) {
FluidStack stack = FluidContainerRegistry.getFluidForFilledItem(itemstack);
if(fluidTank.getFluid() == null || fluidTank.getFluid().isFluidEqual(stack))
{
if (fluidTank.getFluid() == null || fluidTank.getFluid().isFluidEqual(stack)) {
return editMode == ContainerEditMode.EMPTY || editMode == ContainerEditMode.BOTH;
}
}
else if(FluidContainerRegistry.isEmptyContainer(itemstack))
{
} else if (FluidContainerRegistry.isEmptyContainer(itemstack)) {
return editMode == ContainerEditMode.FILL || editMode == ContainerEditMode.BOTH;
}
}
return false;
}
@@ -625,4 +618,19 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
{
return securityComponent;
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
@Override
public void setInventorySlotContents(int slotID, ItemStack itemstack)
{
inventory[slotID] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
}
@@ -599,4 +599,19 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
{
return securityComponent;
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
@Override
public void setInventorySlotContents(int slotID, ItemStack itemstack)
{
inventory[slotID] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
}
@@ -765,4 +765,19 @@ public class TileEntityThermalEvaporationController extends TileEntityThermalEva
{
return new Object[] {inputTank, outputTank};
}
@Override
public int getInventoryStackLimit()
{
return 1;
}
@Override
public void setInventorySlotContents(int slotID, ItemStack itemstack)
{
inventory[slotID] = itemstack;
if(itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
itemstack.stackSize = getInventoryStackLimit();
}
}
}