Fixed Crucible bug where pending solids could be converted to another fluid while tank was empty
Closes #180
This commit is contained in:
parent
5b54f74ad6
commit
67079effd7
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user