forcecompletecraftingtasks() function - #782
Closed
Zexylz wants to merge 3 commits into
Closed
Conversation
…ridge - Add AE2 config integration using reflection to access notification settings - Respect both AdvancedPeripherals and AE2 wireless terminal notify button state - Visual toast notifications now require both settings to be enabled - ComputerCraft events continue to work regardless of notification settings - Use AE2's authentic FinishedJobToast for consistent user experience - Graceful fallback when AE2 config methods cannot be accessed - Update configuration comments to reflect actual AE2 integration Files modified: - CraftingCompleteToastPacket.java: Added AE2 config reflection logic - MEBridgePeripheral.java: Updated notification flow comments - PeripheralsConfig.java: Updated config description for dual-setting system This ensures the ME Bridge peripheral respects user preferences set in AE2's wireless terminal interface, providing seamless integration between the two notification systems.
SirEndii
requested changes
Sep 7, 2025
Contributor
Build PreviewYou can find files attached to the below linked Workflow Run URL (Logs).
|
zyxkad
requested changes
Sep 7, 2025
zyxkad
left a comment
Collaborator
There was a problem hiding this comment.
I hope this is not AI written.
|
|
||
| return MethodResult.of(true, "Successfully force completed task: " + taskIdOrResourceName | ||
| + " (" + inserted + "/" + amount + " items added, completion notification sent)"); | ||
| } catch (Exception e) { |
|
|
||
| // Cancel the job without relying on AE2 notification logic | ||
| cpu.cancelJob(); | ||
| Thread.sleep(50); |
Collaborator
There was a problem hiding this comment.
Do not use Thread.sleep for whatever reason. It is not a reliable way to wait for something.
|
|
||
| MEStorage storage = AEApi.getMonitor(node); | ||
| long inserted = storage.insert(craftedItem, amountToInsert, Actionable.MODULATE, bridge); | ||
| AdvancedPeripherals.debug("[DEBUG] ==> Actually inserted into storage: " + inserted); |
Collaborator
There was a problem hiding this comment.
Do not abuse debug also. If the information provide no help for user to debug an unexpected error, do not print it.
| boolean isNowIdle = !cpu.isBusy(); | ||
|
|
||
| if (inserted == craftedAmount && isNowIdle) { | ||
| return MethodResult.of(true, "Successfully force completed CPU: " + cpuName |
Collaborator
There was a problem hiding this comment.
don't return such complex string. return an easy to read & use constant string.
| ResourceKey resource = status.info().resource(); | ||
|
|
||
| // Insert the completed items into storage first | ||
| long inserted = storage.insert(resource, amount, Action.EXECUTE, Actor.EMPTY); |
Collaborator
There was a problem hiding this comment.
So you just insert something without take anything?
Member
|
I think we can close this AI generated garbage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add forceCompleteCraftingTasks() function
Files modified:
This allows you to instantly complete slow or stuck crafting jobs
PLEASE READ THE GUIDELINES BEFORE MAKING A CONTRIBUTION
What kind of change does this PR introduce? (Bug fix, feature, ...) feature
What is the current behavior? (You can also link to an open issue here) there was no possible way to forcecomplete a job you could cancel one but it wasnt the same as being marked complete vs canceling
What is the new behavior (if this is a feature change)? can now forcecomplete a job
Does this PR introduce a breaking change? (What changes might users need to make in their scripts due to this PR?) should not break anything
forceCompleteCraftingTasks([filter]) -> number
Instantly completes active AE2 crafting jobs by bypassing the normal crafting process and directly inserting the crafted items into the ME storage system.
docs
{}, completes all active crafting jobs