diff options
author | Martin Robertz <dream-master@gmx.net> | 2020-12-14 11:42:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 11:42:10 +0100 |
commit | f732185565d5585035cf47a5a28a612f3f88033a (patch) | |
tree | 0e17fe14466471c8a48e912c5662aa28f8f31e1f /src/main/java/gregtech/common/covers/GT_Cover_Pump.java | |
parent | 209bd9df83e91df6c4f5ec02060087a81f433288 (diff) | |
parent | f3606c5305584bcdb5aabd39e9876e7e3ea801cd (diff) | |
download | GT5-Unofficial-f732185565d5585035cf47a5a28a612f3f88033a.tar.gz GT5-Unofficial-f732185565d5585035cf47a5a28a612f3f88033a.tar.bz2 GT5-Unofficial-f732185565d5585035cf47a5a28a612f3f88033a.zip |
Merge pull request #373 from GTNewHorizons/feature/steam-valve-cover
Feature/steam valve cover
Diffstat (limited to 'src/main/java/gregtech/common/covers/GT_Cover_Pump.java')
-rw-r--r-- | src/main/java/gregtech/common/covers/GT_Cover_Pump.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index a6f7d653b9..ce7a7a789e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -40,7 +40,7 @@ public class GT_Cover_Pump if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid, false); - if (tLiquid.amount > 0) { + if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); @@ -56,7 +56,7 @@ public class GT_Cover_Pump if (tLiquid != null) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false); - if (tLiquid.amount > 0) { + if (tLiquid.amount > 0 && canTransferFluid(tLiquid)) { if (((aCoverVariable % 2 == 0) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= Math.min(1, tLiquid.amount / 10))) { if (aTileEntity.isUniversalEnergyStored(Math.min(1, tLiquid.amount / 10))) { aTileEntity.decreaseStoredEnergyUnits(Math.min(1, tLiquid.amount / 10), true); @@ -73,6 +73,10 @@ public class GT_Cover_Pump return aCoverVariable; } + protected boolean canTransferFluid(FluidStack fluid) { + return true; + } + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12; if(aCoverVariable <0){aCoverVariable = 11;} |