Null check for displayFlow

This commit is contained in:
Anuken
2026-09-18 13:58:24 -04:00
parent c58aac5f67
commit be14e4173e
2 changed files with 2 additions and 2 deletions
@@ -97,7 +97,7 @@ public class ItemModule extends BlockModule{
/** @return a specific item's flow rate in items/s; any value < 0 means not ready.*/
public float getFlowRate(Item item){
return flow == null ? -1f : displayFlow[item.id] * 60;
return flow == null ? -1f : displayFlow != null ? displayFlow[item.id] * 60 : -1f;
}
public boolean hasFlowItem(Item item){
@@ -78,7 +78,7 @@ public class LiquidModule extends BlockModule{
/** @return current liquid's flow rate in u/s; any value < 0 means 'not ready'. */
public float getFlowRate(Liquid liquid){
return flow == null ? -1f : displayFlow[liquid.id] * 60;
return flow == null ? -1f : displayFlow != null ? displayFlow[liquid.id] * 60 : -1f;
}
public boolean hasFlowLiquid(Liquid liquid){