Skip to content

Commit

Permalink
fix incorrect fluid caching (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Glease authored Apr 9, 2024
1 parent 0a03bd9 commit d609bf3
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,18 @@ public void removeListener(IMEMonitorHandlerReceiver<IAEFluidStack> l) {

public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActionSource src) {
int filled = this.handler.fill(this.side, input.getFluidStack(), type == Actionable.MODULATE);
if (filled == 0) {
return input.copy();
} else if ((long) filled == input.getStackSize()) {

if (type == Actionable.MODULATE) {
this.onTick();
}

if ((long) filled == input.getStackSize()) {
return null;
} else {
IAEFluidStack o = input.copy();
o.setStackSize(input.getStackSize() - (long) filled);
if (type == Actionable.MODULATE) {
IAEFluidStack added = o.copy();
this.cache.add(added);
this.postDifference(Collections.singletonList(added));
this.onTick();
}
return o;
}

IAEFluidStack o = input.copy();
o.setStackSize(input.getStackSize() - (long) filled);
return o;
}

public IAEFluidStack extractItems(IAEFluidStack request, Actionable type, BaseActionSource src) {
Expand Down

0 comments on commit d609bf3

Please sign in to comment.