@@ -48,19 +48,12 @@ public static boolean containsAllItems(List<EmiStack> stackList) {
4848 public static void Encode (long initDelay , Minecraft minecraft , EmiRecipe recipe , PatternEncodingTermScreen <?> screen , PatternEncodingTermMenu menu , LocalPlayer player , MultiPlayerGameMode gameMode , int encodedPatternSlot ) {
4949 CompletableFuture .delayedExecutor (initDelay , TimeUnit .MILLISECONDS ).execute (() -> {
5050 minecraft .execute (() -> {
51- // if (containsAllItems(recipe)) {
52- // return;
53- // }
5451 EmiRecipeFiller .performFill (recipe , screen , EmiCraftContext .Type .FILL_BUTTON , EmiCraftContext .Destination .NONE , 1 );
5552 minecraft .getSoundManager ().play (SimpleSoundInstance .forUI (SoundEvents .UI_BUTTON_CLICK , 1.0f ));
5653 });
5754 CompletableFuture .delayedExecutor (per , TimeUnit .MILLISECONDS ).execute (() -> {
5855 minecraft .execute (() -> {
59- if (containsAllItems (recipe )) {
60- return ;
61- }
6256 menu .encode ();
63- recipe .getOutputs ().forEach (emiStack -> EncodedItems .add (emiStack .getId ().toString ()));
6457 LOGGER .debug ("Operating: {}, EncodedItems: {}" , operating , EncodedItems );
6558 });
6659 CompletableFuture .delayedExecutor (per , TimeUnit .MILLISECONDS ).execute (() ->
@@ -84,6 +77,7 @@ public static long CreateTasks(long delay, Minecraft minecraft, @Nullable List<M
8477 for (MaterialNode node : nodes ) {
8578 if (node .recipe != null && node .recipe .getId () != null && !containsAllItems (node .recipe )) {
8679 Encode (delay , minecraft , node .recipe , screen , menu , player , gameMode , encodedPatternSlot );
80+ node .recipe .getOutputs ().forEach (emiStack -> EncodedItems .add (emiStack .getId ().toString ()));
8781 delay += (3 * per + 20 );
8882 }
8983 if (node .children != null ) {
@@ -98,7 +92,7 @@ public static void onKeyPressed(ScreenEvent.KeyPressed.Post event) {
9892 if (event .getScreen () instanceof PatternEncodingTermScreen <?> screen ) {
9993 LOGGER .debug ("Catched" );
10094 PatternEncodingTermMenu menu = screen .getMenu ();
101- int blankPatternSlot = ((AEBaseMenuAccessor ) menu ).getSlotsBySemantic ().get (SlotSemantics .BLANK_PATTERN ).getFirst ().index ;
95+ // int blankPatternSlot = ((AEBaseMenuAccessor) menu).getSlotsBySemantic().get(SlotSemantics.BLANK_PATTERN).getFirst().index;
10296 int encodedPatternSlot = ((AEBaseMenuAccessor ) menu ).getSlotsBySemantic ().get (SlotSemantics .ENCODED_PATTERN ).getFirst ().index ;
10397 if (BoM .craftingMode ) {
10498 LOGGER .debug ("BoM crafting" );
@@ -109,12 +103,12 @@ public static void onKeyPressed(ScreenEvent.KeyPressed.Post event) {
109103
110104 MaterialNode goal = BoM .tree .goal ;
111105 operating = true ;
112- LOGGER .debug (String . valueOf ( operating ) );
106+ LOGGER .debug (" operating started" );
113107 long maxDelay = CreateTasks (0 , minecraft , List .of (goal ), screen , menu , player , gameMode , encodedPatternSlot );
114108 CompletableFuture .delayedExecutor (maxDelay + per , TimeUnit .MILLISECONDS ).execute (() -> {
115109 operating = false ;
116110 BoM .craftingMode =false ;
117- LOGGER .debug (String . valueOf ( operating ) );
111+ LOGGER .debug (" operating finished" );
118112 });
119113 }
120114 } else {
0 commit comments