From 913cc1819ab3aaa0e831f14fc90bb90d33301d1e Mon Sep 17 00:00:00 2001 From: deirn Date: Sun, 28 Apr 2024 02:00:51 +0700 Subject: [PATCH] fixed ir progress having no io items closes #72 --- .../indrev/provider/CraftingMachineProvider.java | 14 +++++++++++++- .../module/indrev/provider/MachineProvider.java | 5 ----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/CraftingMachineProvider.java b/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/CraftingMachineProvider.java index b4fb0dc..895eb0a 100644 --- a/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/CraftingMachineProvider.java +++ b/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/CraftingMachineProvider.java @@ -21,7 +21,19 @@ public void appendData(IDataWriter data, IServerAccessor 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); + } }); } diff --git a/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/MachineProvider.java b/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/MachineProvider.java index bfa427e..4cca38c 100644 --- a/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/MachineProvider.java +++ b/modules/fabric/industrial-revolution/src/main/java/lol/bai/megane/module/indrev/provider/MachineProvider.java @@ -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; @@ -32,10 +31,6 @@ public void appendData(IDataWriter data, IServerAccessor> var inventory = component.getInventory(); res.add(ItemData.of(config).vanilla(inventory)); }); - - data.add(FluidData.class, res -> { - - }); } }