Skip to content

Commit

Permalink
Add proper support for dense steam to steam valve and regulator (#3835)
Browse files Browse the repository at this point in the history
  • Loading branch information
C0bra5 authored Jan 20, 2025
1 parent 186463e commit 6cbc49c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.interfaces.ITexture;
import gregtech.api.util.GTModHandler;

public class CoverSteamRegulator extends CoverFluidRegulator {

Expand All @@ -13,11 +12,6 @@ public CoverSteamRegulator(int aTransferRate, ITexture coverTexture) {

@Override
protected boolean canTransferFluid(FluidStack fluid) {
if (fluid == null) return false;
String fluidname = fluid.getFluid()
.getName();
return GTModHandler.isAnySteam(fluid) || GTModHandler.isSuperHeatedSteam(fluid)
|| fluidname.equals("supercriticalsteam")
|| fluidname.equals("densesupercriticalsteam");
return CoverSteamValve.isFluidCompatible(fluid);
}
}
11 changes: 9 additions & 2 deletions src/main/java/gregtech/common/covers/CoverSteamValve.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.enums.Materials;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.GTModHandler;
Expand All @@ -21,11 +22,17 @@ public boolean isRedstoneSensitive(ForgeDirection side, int aCoverID, int aCover

@Override
protected boolean canTransferFluid(FluidStack fluid) {
if (fluid == null) return false;
return isFluidCompatible(fluid);
}

public static boolean isFluidCompatible(FluidStack fluid) {
if (fluid == null || fluid.getFluid() == null) return false;
String fluidname = fluid.getFluid()
.getName();
return GTModHandler.isAnySteam(fluid) || GTModHandler.isSuperHeatedSteam(fluid)
|| fluidname.equals("supercriticalsteam")
|| fluidname.equals("densesupercriticalsteam");
|| fluid.getFluid() == Materials.DenseSteam.mGas
|| fluid.getFluid() == Materials.DenseSuperheatedSteam.mGas
|| fluid.getFluid() == Materials.DenseSupercriticalSteam.mGas;
}
}

0 comments on commit 6cbc49c

Please sign in to comment.