Skip to content

Commit

Permalink
fixed ir progress having no io items
Browse files Browse the repository at this point in the history
closes #72
  • Loading branch information
deirn committed Apr 27, 2024
1 parent 321d20e commit 913cc18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ public void appendData(IDataWriter data, IServerAccessor<CraftingMachineBlockEnt
ratio = Math.max(ratio, current / max);
}

res.add(ProgressData.ratio(ratio));
if (ratio > 0) {
var progressData = ProgressData.ratio(ratio);

var inventoryComponent = accessor.getTarget().getInventoryComponent();
if (inventoryComponent != null) {
var inventory = inventoryComponent.getInventory();
progressData.itemGetter(inventory::getItem)
.input(inventory.getInputSlots())
.output(inventory.getOutputSlots());
}

res.add(progressData);
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import mcp.mobius.waila.api.IPluginConfig;
import mcp.mobius.waila.api.IServerAccessor;
import mcp.mobius.waila.api.data.EnergyData;
import mcp.mobius.waila.api.data.FluidData;
import mcp.mobius.waila.api.data.ItemData;
import me.steven.indrev.api.machines.Tier;
import me.steven.indrev.blockentities.MachineBlockEntity;
Expand All @@ -32,10 +31,6 @@ public void appendData(IDataWriter data, IServerAccessor<MachineBlockEntity<?>>
var inventory = component.getInventory();
res.add(ItemData.of(config).vanilla(inventory));
});

data.add(FluidData.class, res -> {

});
}

}

0 comments on commit 913cc18

Please sign in to comment.