File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 33import com .refinedmods .refinedstorage .api .autocrafting .ICraftingManager ;
44import com .refinedmods .refinedstorage .api .autocrafting .task .CalculationResultType ;
55import com .refinedmods .refinedstorage .api .autocrafting .task .ICalculationResult ;
6+ import com .refinedmods .refinedstorage .api .autocrafting .task .ICraftingRequestInfo ;
67import com .refinedmods .refinedstorage .api .autocrafting .task .ICraftingTask ;
78import dan200 .computercraft .api .peripheral .IComputerAccess ;
89import de .srendi .advancedperipherals .common .util .LuaConverter ;
@@ -52,12 +53,20 @@ public Object getParsedRequestedItem() {
5253
5354 @ Override
5455 public long getElapsedTime () {
55- return 0 ;
56+ if (craftingTask == null ) {
57+ return -1 ;
58+ }
59+ return System .nanoTime () - craftingTask .getStartTime () * 1_000 ;
5660 }
5761
5862 @ Override
5963 public long getTotalItems () {
60- return 0 ;
64+ if (craftingTask == null || craftingTask .getRequested () == null ) {
65+ return -1 ;
66+ }
67+ ICraftingRequestInfo requestInfo = craftingTask .getRequested ();
68+
69+ return requestInfo .getFluid () != null ? requestInfo .getFluid ().getAmount () : requestInfo .getItem ().getCount ();
6170 }
6271
6372 @ Override
You can’t perform that action at this time.
0 commit comments