Skip to content

Commit

Permalink
Fix fuel info being out of sync when tank position changes (#4881)
Browse files Browse the repository at this point in the history
Still need to fix the fuel info not showing anything when the last bit is used, seems currentFuel is no longer added
  • Loading branch information
KnightMiner committed Sep 4, 2022
1 parent f13ee7e commit db2014d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class FuelModule implements ContainerData {
private void reset() {
this.fluidHandler = null;
this.itemHandler = null;
this.tankDisplayHandlers = null;
this.lastPos = NULL_POS;
}

Expand Down Expand Up @@ -256,6 +257,7 @@ private int tryFindFuel(BlockPos pos, boolean consume) {
if (temperature.isPresent()) {
itemHandler = null;
fluidHandler = capability;
tankDisplayHandlers = null;
capability.addListener(fluidListener);
lastPos = pos;
return temperature.get();
Expand All @@ -265,6 +267,7 @@ private int tryFindFuel(BlockPos pos, boolean consume) {
temperature = itemCap.map(trySolidFuel(consume));
if (temperature.isPresent()) {
fluidHandler = null;
tankDisplayHandlers = null;
itemHandler = itemCap;
itemCap.addListener(itemListener);
lastPos = pos;
Expand Down Expand Up @@ -398,6 +401,7 @@ public void set(int index, int value) {
}
fluidHandler = null;
itemHandler = null;
tankDisplayHandlers = null;
}
}
}
Expand Down

0 comments on commit db2014d

Please sign in to comment.