diff --git a/changelog.md b/changelog.md index 4da8db99..18a20595 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ ## Ex Deorum 3.11 - Fixed End Cakes crashing fake players (#178) +- Fixed Compressed Sieves not allowing simultaneous insertion of material even when Simultaneous Compressed Sieve Usage was enabled +- Fixed Crucible bug where pending solids could be converted to another fluid while tank was empty (#180) ## Ex Deorum 3.10 - Now requires KubeJS 7.2 to fix incompatibility (#158) diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java index 347ee031..60fd496a 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/AbstractCrucibleBlockEntity.java @@ -208,10 +208,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(); updateLight(this.level, this.worldPosition, this.fluid); } @@ -242,7 +243,7 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity { var result = recipe.getResult(); var contained = this.tank.getFluid(); - if (FluidStack.isSameFluidSameComponents(result, contained) || contained.isEmpty()) { + if (FluidStack.isSameFluidSameComponents(result, contained) || (contained.isEmpty() && canAddToPendingFluid(result))) { return result.getAmount() + this.solids <= MAX_SOLIDS ? InsertionResult.YES : InsertionResult.FULL; } } @@ -250,6 +251,10 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity { return InsertionResult.NO; } + private boolean canAddToPendingFluid(FluidStack result) { + return this.solids == 0 || this.fluid == null || result.getFluid() == this.fluid; + } + public abstract int getMeltingRate(); public int getSolids() { @@ -304,7 +309,7 @@ public abstract class AbstractCrucibleBlockEntity extends ETankBlockEntity { } } - private static class FluidHandler extends FluidHelper { + private class FluidHandler extends FluidHelper { public FluidHandler() { super(MAX_FLUID_CAPACITY); } @@ -313,6 +318,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; + } + + updateLight(AbstractCrucibleBlockEntity.this.level, AbstractCrucibleBlockEntity.this.worldPosition, this.fluid.getFluid()); + AbstractCrucibleBlockEntity.this.markUpdated(); + } } // inner class