Skip to content

Commit

Permalink
Makes boilers "getSteamCapacity() aware" (#2131)
Browse files Browse the repository at this point in the history
* Import getSteamCapacity from GT++ boilers

* spotless apply

---------

Co-authored-by: Wilhelm Schuster <dev@rot13.io>
  • Loading branch information
Lyfts and wlhlm committed Jul 11, 2023
1 parent 6c41b18 commit 5113d4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ private void updateFuelTimed(IGregTechTileEntity aBaseMetaTileEntity, long aTick
}

protected void ventSteamIfTankIsFull() {
if ((this.mSteam != null) && (this.mSteam.amount > getCapacity())) {
if ((this.mSteam != null) && (this.mSteam.amount > getSteamCapacity())) {
sendSound(SOUND_EVENT_LET_OFF_EXCESS_STEAM);
this.mSteam.amount = getCapacity() * 3 / 4;
this.mSteam.amount = getSteamCapacity() * 3 / 4;
}
}

Expand Down Expand Up @@ -391,6 +391,10 @@ public int getCapacity() {
return 16000;
}

protected int getSteamCapacity() {
return getCapacity();
}

protected abstract int getProductionPerSecond();

protected abstract int getMaxTemperature();
Expand Down Expand Up @@ -440,7 +444,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont
.widget(createFuelSlot())
.widget(createAshSlot())
.widget(
new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity())
new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getSteamCapacity())
.setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10)
.setDirection(ProgressBar.Direction.UP)
.setPos(70, 25)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public int fill(FluidStack aFluid, boolean doFill) {
public FluidTankInfo[] getTankInfo(ForgeDirection side) {
return new FluidTankInfo[] { super.getTankInfo(side)[0],
new FluidTankInfo(this.lavaTank.getFluid(), this.lavaTank.getCapacity()),
new FluidTankInfo(getDrainableStack(), getCapacity()) };
new FluidTankInfo(getDrainableStack(), getSteamCapacity()) };
}

@Override
Expand All @@ -479,7 +479,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont
.setPos(115, 61))
.widget(createAshSlot())
.widget(
new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity())
new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getSteamCapacity())
.setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10)
.setDirection(ProgressBar.Direction.UP)
.setPos(70, 25)
Expand Down

0 comments on commit 5113d4b

Please sign in to comment.