aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/covers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/covers')
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Pump.java8
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java16
2 files changed, 22 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;}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java
new file mode 100644
index 0000000000..8ac8a0dae9
--- /dev/null
+++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java
@@ -0,0 +1,16 @@
+package gregtech.common.covers;
+
+import gregtech.api.util.GT_ModHandler;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_Cover_SteamValve extends GT_Cover_Pump {
+
+ public GT_Cover_SteamValve(int aTransferRate) {
+ super(aTransferRate);
+ }
+
+ @Override
+ protected boolean canTransferFluid(FluidStack fluid) {
+ return GT_ModHandler.isAnySteam(fluid);
+ }
+}