Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes boilers "getSteamCapacity() aware" #2131

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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