Fixed Crucible bug where pending solids could be converted to another fluid while tank was empty

Closes #180
This commit is contained in:
thedarkcolour 2026-05-31 17:16:34 -07:00
parent 5b54f74ad6
commit 67079effd7
3 changed files with 23 additions and 3 deletions

View File

@ -146,6 +146,8 @@ dependencies {
modImplementation("curse.maven:cyclic-239286:4994392")
modImplementation("curse.maven:flib-661261:4724762")
modImplementation("curse.maven:thirst-was-taken-679270:6660408")
modImplementation("curse.maven:tinkers-construct-74072:7449219")
modImplementation("curse.maven:mantel-74924:7563777")
// DEV ONLY
compileOnly('org.jetbrains:annotations:23.0.0')

View File

@ -1,3 +1,6 @@
## Ex Deorum 1.50
- Fixed Crucible bug where pending solids could be converted to another fluid while tank was empty (#180)
## Ex Deorum 1.49
- Fixed more issues with _Thirst Was Taken_, thanks to pawjwp (#170)
- Fixed Dust not having a map color (#169)

View File

@ -202,10 +202,11 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity {
}
var result = recipe.getResult();
var contained = this.tank.getFluid();
var hadPendingSolids = this.solids > 0;
shrinkAction.accept(item);
this.solids = (short) Math.min(this.solids + result.getAmount(), MAX_SOLIDS);
if (contained.isEmpty()) {
if (contained.isEmpty() && !hadPendingSolids) {
this.fluid = result.getFluid();
this.needsLightUpdate = true;
}
@ -234,12 +235,16 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity {
var result = recipe.getResult();
var contained = this.tank.getFluid();
return (result.isFluidEqual(contained) || contained.isEmpty()) && result.getAmount() + this.solids <= MAX_SOLIDS;
return (result.isFluidEqual(contained) || (contained.isEmpty() && canAddToPendingFluid(result))) && result.getAmount() + this.solids <= MAX_SOLIDS;
}
return false;
}
private boolean canAddToPendingFluid(FluidStack result) {
return this.solids == 0 || this.fluid == null || result.getFluid() == this.fluid;
}
public abstract int getMeltingRate();
public int getSolids() {
@ -296,7 +301,7 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity {
}
}
private static class FluidHandler extends FluidHelper {
private class FluidHandler extends FluidHelper {
public FluidHandler() {
super(MAX_FLUID_CAPACITY);
}
@ -305,6 +310,16 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity {
public boolean isFluidValid(FluidStack stack) {
return false;
}
@Override
protected void onContentsChanged() {
if (this.fluid.isEmpty() && AbstractCrucibleBlockEntity.this.solids == 0) {
AbstractCrucibleBlockEntity.this.fluid = null;
}
AbstractCrucibleBlockEntity.this.needsLightUpdate = true;
AbstractCrucibleBlockEntity.this.markUpdated();
}
}
// inner class