diff options
Diffstat (limited to 'src/main/java/gregtech/common/covers')
3 files changed, 34 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index df0b16c297..b02610ebf4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -36,13 +36,13 @@ import io.netty.buffer.ByteBuf; /** * Cover variable - * + * * <pre> * 1111 1111 1111 1111 1111 1111 1111 1111 * |- interval-| |- flow rate 2 compl. -| * ^ export? * </pre> - * + * * Concat export and flow rate 2 compl. together to get actual flow rate. A positive actual flow rate is export, and * vice versa. * <p> @@ -123,7 +123,7 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_Fluid if (tTank1 != null && tTank2 != null) { allowFluid = true; FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aCoverVariable.speed), false); - if (tLiquid != null) { + if (tLiquid != null && this.canTransferFluid(tLiquid)) { tLiquid = tLiquid.copy(); tLiquid.amount = tTank2.fill(directionTo, tLiquid, false); if (tLiquid.amount > 0) { @@ -184,6 +184,10 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_Fluid return true; } + protected boolean canTransferFluid(FluidStack fluid) { + return true; + } + @Override public boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, FluidRegulatorData aCoverVariable, ICoverable aTileEntity) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamRegulator.java new file mode 100644 index 0000000000..e9081006e2 --- /dev/null +++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamRegulator.java @@ -0,0 +1,26 @@ +package gregtech.common.covers; + +import net.minecraftforge.fluids.FluidStack; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.util.GT_ModHandler; + +public class GT_Cover_SteamRegulator extends GT_Cover_FluidRegulator { + + /** + * @deprecated use {@link #GT_Cover_SteamRegulator(int aTransferRate, ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_SteamRegulator(int aTransferRate) { + this(aTransferRate, null); + } + + public GT_Cover_SteamRegulator(int aTransferRate, ITexture coverTexture) { + super(aTransferRate, coverTexture); + } + + @Override + protected boolean canTransferFluid(FluidStack fluid) { + return GT_ModHandler.isAnySteam(fluid) || GT_ModHandler.isSuperHeatedSteam(fluid); + } +} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java index 916f5ed75e..0c24e135f1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java @@ -28,6 +28,6 @@ public class GT_Cover_SteamValve extends GT_Cover_Pump { @Override protected boolean canTransferFluid(FluidStack fluid) { - return GT_ModHandler.isAnySteam(fluid); + return GT_ModHandler.isAnySteam(fluid) || GT_ModHandler.isSuperHeatedSteam(fluid); } } |
