### Install Project Dependencies Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/visual-studio-code/super-factory-manager-language/README.md This command installs all the necessary Node.js dependencies required for the Super Factory Manager VSCode extension. Ensure you are in the correct directory before running this command. ```bash npm install ``` -------------------------------- ### Launch Minecraft Client with Gradle (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Starts a Minecraft client instance for testing purposes using a Gradle task. This command is configured to use a specific client profile ('runClient_teamy') which may alter default settings like window size. ```shell ./gradlew runClient_teamy ``` -------------------------------- ### Run In-Game Tests with Gradle (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Starts a Minecraft server to run in-game tests. This task is used to validate game mechanics and mod interactions within the game environment. ```shell ./gradlew runGameTestServer ``` -------------------------------- ### Trigger Example: Every 5 Seconds (Lua) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/examples/README.md Illustrates a trigger that executes code every 5 seconds. This shows the flexibility in timing triggers, allowing for time-based operations. ```lua every 5 seconds do -- do stuff here end ``` -------------------------------- ### Trigger Example: Every 20 Ticks (Lua) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/examples/README.md Demonstrates a basic trigger that executes a block of code every 20 ticks. This is a fundamental way to schedule actions within the SFM environment. ```lua EVERY 20 TICKS DO -- do stuff here END ``` -------------------------------- ### Superfactorymanager: Fluid Input/Output Between Tanks Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/visual-studio-code/super-factory-manager-language/tests/markdown.md This script defines a process that runs every 20 ticks to transfer fluids. It takes input from 'tank1' and outputs to 'tank2'. The script also includes a mechanism to report 2 errors and 2 warnings, and a 'forget' command to clear previous states. ```sfm every 20 ticks do input from a output from b -- 2 errors and 2 warnings forget INPUT fluid:mek: FROM tank1 OUTPUT TO tank2 end ``` -------------------------------- ### Navigate to VSCode Extension Directory Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/visual-studio-code/super-factory-manager-language/README.md This command changes the current directory to the specific folder for the Super Factory Manager language extension within the cloned repository. This is a necessary step before installing dependencies. ```bash cd vscodeextension/super-factory-manager-language/ ``` -------------------------------- ### SFM: Named Program with Specific Input Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/PERFORMANCE.md This SFM code snippet defines a named program ('second') that inputs specific items ('stone', 'iron_ingot') from an inventory. It is provided as an example for users to compare performance against other program configurations. ```sfm NAME "second" EVERY 20 TICKS DO INPUT stone, iron_ingot FROM a OUTPUT TO b END ``` -------------------------------- ### Refresh Gradle Dependencies (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/TROUBLESHOOTING.md Performs a Gradle build after refreshing all project dependencies. This command is useful for ensuring that the project is using the latest available dependency versions and can resolve issues related to outdated or corrupted dependencies. The `--no-daemon` flag is also used here for consistency. ```powershell .\gradlew --no-daemon --refresh-dependencies build ``` -------------------------------- ### Clean Gradle Build (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/TROUBLESHOOTING.md Executes a clean build using Gradle, removing intermediate build files. This is a common first step when encountering build or dependency issues. The `--no-daemon` flag ensures that the Gradle daemon is not used, which can sometimes prevent clean builds from completing successfully. ```powershell .\gradlew.bat --no-daemon clean ``` -------------------------------- ### Accessing Inventory Slots and Sides in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Access specific inventory slots (0-indexed) and block sides for input and output operations. Examples include accessing multiple slots and sides for furnaces, distinguishing input, fuel, and output. ```sfml EVERY 20 TICKS DO -- Access specific slots (0-indexed) and sides INPUT FROM a TOP, WEST SIDE SLOTS 0,1,3-4,7-9,21 OUTPUT TO a BOTTOM SIDE SLOTS 2 END -- Furnace example: top=input, bottom=fuel+output EVERY 20 TICKS DO INPUT FROM chest OUTPUT oak_log TO furnace TOP SIDE -- items to smelt OUTPUT coal, charcoal TO furnace BOTTOM SIDE -- fuel END EVERY 20 TICKS DO INPUT FROM furnace BOTTOM SIDE -- smelted results OUTPUT TO chest END ``` -------------------------------- ### Fix 'No Tests Found' Error (Gradle) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/TROUBLESHOOTING.md A workaround for the 'No tests found' error in the game. This issue can occur after cleaning the project or removing the 'run' directory. Running the `runGameTestServer` Gradle task seems to re-initialize or discover the test classes, resolving the problem for subsequent tasks like `runClient teamy`. ```gradle gradlew runGameTestServer ``` -------------------------------- ### Fix VerifyError in Exception Handler (Java/Gradle) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/TROUBLESHOOTING.md Addresses a 'VerifyError: Catch type is not a subclass of Throwable' occurring during debugging in IntelliJ IDEA. This error often relates to JVM arguments like '-XX:+AllowEnhancedClassRedefinition' and can be resolved by downgrading IntelliJ IDEA or adjusting JVM options. The provided log snippet details the specific error and its context within the BootstrapLauncher. ```log OpenJDK 64-Bit Server VM warning: Option AllowRedefinitionToAddDeleteMethods was deprecated in version 13.0 and will likely be removed in a future release. Connected to the target VM, address: '127.0.0.1:27473', transport: 'socket' Error: Unable to initialize main class cpw.mods.bootstraplauncher.BootstrapLauncher in module cpw.mods.bootstraplauncher Caused by: java.lang.VerifyError: Catch type is not a subclass of Throwable in exception handler 47 Exception Details: Location: cpw/mods/mods/bootstraplauncher/BootstrapLauncher.loadLegacyClassPath()Ljava/util/List; @47: astore_2 Reason: Type 'java/io/IOException' (constant pool 328) is not assignable to 'java/lang/Throwable' Bytecode: 0000000: 1301 3cb8 012c 4b2a c600 372a 03bd 0016 0000010: b800 4e4c 2b03 bd00 76b8 013e 9900 232b 0000020: 03bd 0076 b801 4199 0018 2bb8 0144 b04d 0000030: bb01 4a59 2aba 014c 0000 2cb7 014d bf12 0000040: 0d13 0150 b801 2cb8 0025 4c2b 1301 52b8 0000050: 0154 572b b601 5a9a 0007 b801 5eb0 2bb2 0000060: 000f b600 2ab8 0160 b0 Exception Handler Table: bci [42, 46] => handler: 47 Stackmap Table: full_frame(@47,{Object[#22],Object[#85]},{Object[#328]}) chop_frame(@63,1) append_frame(@94,Object[#22]) Disconnected from the target VM, address: '127.0.0.1:27473', transport: 'socket' Process finished with exit code 1 ``` -------------------------------- ### Display sfm-propagate-changes Gradle Command Help (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Displays the help information specifically for the `gradle` subcommand of the `sfm-propagate-changes.exe` CLI tool. This subcommand is used to run arbitrary Gradle tasks across multiple worktrees sequentially. ```powershell sfm-propagate-changes.exe gradle --help ``` -------------------------------- ### Display sfm-propagate-changes CLI Help (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Shows the help message for the `sfm-propagate-changes.exe` command-line interface tool. This tool is written in Rust and automates common commands across project worktrees. ```powershell sfm-propagate-changes.exe --help ``` -------------------------------- ### Run Gradle Tasks with sfm-propagate-changes.exe gradle Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Executes arbitrary Gradle tasks sequentially across worktrees. It accepts a list of tasks and optional filters for Minecraft versions and log visibility. Errors can be handled by continuing or stopping execution. ```bash sfm-propagate-changes.exe gradle --help sfm-propagate-changes.exe gradle [OPTIONS] Run arbitrary gradle task(s) for each worktree in strict sequence ARGUMENTS: Gradle tasks to run (for example: `runData`, `runGameTestServer`, `test`). OPTIONS: --mc Minecraft version filter expression for branch names (examples: `>=1.21.0`, `<1.20`, `=1.20.4`). --hide-logs If set, hide stdout of each gradle process while it runs. --continue-on-error If set, continue with later branches after a task failure. ``` -------------------------------- ### sfm-propagate-changes.exe server launch Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Launches tracked servers by executing their `run.bat` scripts and waiting for successful completion. Supports filtering by Minecraft version. ```APIDOC ## sfm-propagate-changes.exe server launch ### Description Launch tracked servers by running each `run.bat` and waiting for successful exit. ### Method CLI COMMAND ### Endpoint `sfm-propagate-changes.exe server launch [OPTIONS]` ### Parameters #### Path Parameters None #### Query Parameters None #### Arguments None #### Options * **--mc** (STRING) - Optional - Minecraft version filter expression for tracked servers (examples: `>=1.21.0`, `<1.20`, `=1.20.4`). ### Request Example ```bash sfm-propagate-changes.exe server launch --mc "=1.21.0" ``` ### Response #### Success Response (0) Successful launch and exit of all tracked servers matching the filter. #### Response Example ``` [Output indicating servers launched and exited successfully] ``` #### Error Response * **Non-zero codes** - Indicate errors during server launch or execution. ``` -------------------------------- ### Launch Servers with sfm-propagate-changes.exe server launch Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Launches tracked servers by executing their respective 'run.bat' scripts and waiting for successful completion. It supports filtering servers based on Minecraft version. ```bash sfm-propagate-changes.exe server launch [OPTIONS] Launch tracked servers by running each `run.bat` and waiting for successful exit OPTIONS: --mc Minecraft version filter expression for tracked servers (examples: `>=1.21.0`, `<1.20`, `=1.20.4`). ``` -------------------------------- ### sfm-propagate-changes.exe gradle Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Runs arbitrary Gradle tasks sequentially across worktrees. Allows filtering by Minecraft version, hiding logs, and continuing on error. ```APIDOC ## sfm-propagate-changes.exe gradle ### Description Run arbitrary gradle task(s) for each worktree in strict sequence. ### Method CLI COMMAND ### Endpoint `sfm-propagate-changes.exe gradle ` ### Parameters #### Path Parameters None #### Query Parameters None #### Arguments * **TASKS** (STRING) - Required - Gradle tasks to run (for example: `runData`, `runGameTestServer`, `test`). #### Options * **--mc** (STRING) - Optional - Minecraft version filter expression for branch names (examples: `>=1.21.0`, `<1.20`, `=1.20.4`). * **--hide-logs** - Optional - If set, hide stdout of each gradle process while it runs. * **--continue-on-error** - Optional - If set, continue with later branches after a task failure. ### Request Example ```bash sfm-propagate-changes.exe gradle runData --mc ">=1.20" --hide-logs ``` ### Response #### Success Response (0) Successful execution of Gradle tasks across worktrees. #### Response Example ``` [Output of Gradle tasks] ``` #### Error Response * **1** - Task failure on one or more worktrees (if `--continue-on-error` is not set). * **Other non-zero codes** - Indicate specific command execution errors. ``` -------------------------------- ### List Git Worktrees (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Lists all active Git worktrees for the project, indicating the Minecraft version and commit hash for each. This is useful for understanding the project's multi-version structure. ```powershell git worktree list ``` -------------------------------- ### Run JUnit Tests with Gradle (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Executes all JUnit tests defined within the project. This command is used for running unit tests to verify the correctness of individual code components. ```shell ./gradlew test ``` -------------------------------- ### Git Tagging and Pushing Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Commands to tag a new release and push the tags to the Git repository. These are typically run using a helper script. ```bash sfm-propagate-changes.exe git tag sfm-propagate-changes.exe git push --tags ``` -------------------------------- ### Validate Formatting and Build with check-all.ps1 (PowerShell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Runs a PowerShell script to validate Rust code formatting, linting, and check for build errors. This script should be executed after making changes to the Rust CLI code. ```powershell ./platform/cli/sfm-propagate-changes/check-all.ps1 ``` -------------------------------- ### Compile Java Code with Gradle (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Runs Gradle tasks to compile various Java source sets, including main, datagen, game tests, and unit tests. This command is used to check for compile-time errors. ```shell ./gradlew compileJava compileDatagenJava compileGameTestJava compileTestJava ``` -------------------------------- ### Compare Java Files Between Repositories Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/todo.md This PowerShell script compares Java files between two directory structures, simulating repository comparisons. It identifies files present in the old repository's 'src' directory but missing in the new repository's 'platform/minecraft/src' directory, accounting for known intentional deletions. ```powershell # For each version branch (1.20.3, 1.20.4, 1.21.0, 1.21.1): # Compare repos/ vs repos2/ accounting for path transformation $versions = @( @{ old = "D:\\Repos\\Minecraft\\SFM\\repos\\SuperFactoryManager 1.20.3"; new = "D:\\Repos\\Minecraft\\SFM\\repos2\\1.20.3" }, @{ old = "D:\\Repos\\Minecraft\\SFM\\repos\\SuperFactoryManager 1.20.4"; new = "D:\\Repos\\Minecraft\\SFM\\repos2\\1.20.4" }, @{ old = "D:\\Repos\\Minecraft\\SFM\\repos\\SuperFactoryManager 1.21.0"; new = "D:\\Repos\\Minecraft\\SFM\\repos2\\1.21.0" }, @{ old = "D:\\Repos\\Minecraft\\SFM\\repos\\SuperFactoryManager 1.21.1"; new = "D:\\Repos\\Minecraft\\SFM\\repos2\\1.21.1" } ) foreach ($v in $versions) { Write-Host "=== Checking $($v.new) ===" -ForegroundColor Cyan # Get Java files from old repo under src/ $oldFiles = Get-ChildItem -Path "$($v.old)\src" -Recurse -Filter "*.java" -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName.Replace("$($v.old)\src\", "") } # Get Java files from new repo under platform/minecraft/src/ $newFiles = Get-ChildItem -Path "$($v.new)\platform\minecraft\src" -Recurse -Filter "*.java" -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName.Replace("$($v.new)\platform\minecraft\src\", "") } # Find files in old but not in new $missing = $oldFiles | Where-Object { $_ -notin $newFiles } if ($missing) { Write-Host "Missing files:" -ForegroundColor Red $missing | ForEach-Object { Write-Host " $_" } } else { Write-Host "All files accounted for" -ForegroundColor Green } } # Known intentional deletions to ignore: # - **/util/NotStored.java # - **/util/Stored.java # - **/watertanknetwork/WaterNetwork.java # - **/gametest/tests/ai/*.java ``` -------------------------------- ### Generate Datapack Resources with Gradle (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Executes the Gradle task responsible for generating essential datapack resources such as recipes, tags, and models. This command is critical after modifying datagen source files. ```shell ./gradlew runDatagen ``` -------------------------------- ### Run Gradle Build Task (Shell) Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/AGENTS.md Executes the standard Gradle build task, which is responsible for compiling code and creating JAR files. This command is typically used towards the end of the development cycle. ```shell ./gradlew build ``` -------------------------------- ### Modrinth Release Commands Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Commands to check and upload a new release to Modrinth using the `sfm-propagate-changes.exe` tool. This makes the mod available on the Modrinth platform. ```bash sfm-propagate-changes.exe modrinth release check sfm-propagate-changes.exe modrinth release now ``` -------------------------------- ### Clone Super Factory Manager Repository Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/visual-studio-code/super-factory-manager-language/README.md This command clones the Super Factory Manager GitHub repository to your local machine, allowing you to access and contribute to the project's source code. ```bash git clone https://github.com/TeamDman/SuperFactoryManager.git ``` -------------------------------- ### CurseForge Release Commands Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md Commands to check and upload a new release to CurseForge using the `sfm-propagate-changes.exe` tool. This ensures the mod is available for download. ```bash sfm-propagate-changes.exe curseforge release check sfm-propagate-changes.exe curseforge release now ``` -------------------------------- ### SFM: Count by Type with Caching Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/PERFORMANCE.md This SFM code snippet demonstrates counting items by type using the 'EACH' keyword, which internally utilizes a cache for improved performance by enumerating the registry for each resource type. ```sfm EVERY 20 TICKS DO INPUT 2 EACH *ingot* FROM a OUTPUT TO b END ``` -------------------------------- ### GitHub Release Script Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md PowerShell script to create a GitHub release and upload jar files as attachments. This automates the release process on GitHub. ```powershell pwsh -File ./platform/pwsh/github-release.ps1 ``` -------------------------------- ### Configure Lexer for Syntax Highlighting Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/visual-studio-code/super-factory-manager-language/README.md This code snippet shows a modification made to the ANTLR grammar file (.g4) to configure the lexer. The `INCLUDE_UNUSED` flag is set to `false` to prevent syntax highlighting issues with unexpected tokens. ```java @lexer::members { public boolean INCLUDE_UNUSED = false; // we want syntax highlighting to not break on unexpected tokens } ``` -------------------------------- ### SFM: Named Program with General Input Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/PERFORMANCE.md This SFM code snippet defines a named program ('first') with a general input operation. It serves as a baseline for users to measure and compare performance using the in-game performance graph. ```sfm NAME "first" EVERY 20 TICKS DO INPUT FROM a OUTPUT TO b END ``` -------------------------------- ### SFM: Basic Input/Output with Object Pooling Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/PERFORMANCE.md This SFM code snippet shows a basic input and output operation. Object pooling is employed here to enhance performance when dealing with a large number of inventories, reducing object creation overhead. ```sfm EVERY 20 TICKS DO INPUT FROM a OUTPUT TO b END ``` -------------------------------- ### Quantity Limits in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Illustrates how to control the quantity of items moved per execution cycle using SFML's INPUT and OUTPUT statements. This includes limiting individual item extractions/insertions and applying limits per source/destination. ```sfml EVERY 20 TICKS DO INPUT 1 FROM a -- extract only 1 item at a time OUTPUT TO b END EVERY 20 TICKS DO INPUT FROM a OUTPUT 1 TO b -- insert only 1 item at a time END EVERY 20 TICKS DO INPUT 5 FROM EACH a -- extract 5 items from each "a" inventory OUTPUT 1 TO EACH b -- insert 1 item into each "b" inventory END ``` -------------------------------- ### Basic Item Movement in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Demonstrates the fundamental INPUT and OUTPUT statements in SFML for moving items between labeled inventories. This is the core of resource automation in the mod. ```sfml NAME "A simple program" EVERY 20 TICKS DO -- INPUT gathers resources from labeled inventories INPUT FROM a -- OUTPUT distributes gathered resources to destinations OUTPUT TO b END ``` -------------------------------- ### Conditional Logic with IF Statements in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Execute statements based on inventory contents using IF statements. Supports compound conditions with AND/OR, and qualifiers like OVERALL, EVERY, EACH, SOME, ONE, and LONE for multi-inventory checks. Also demonstrates ELSE IF chains for complex decision-making. ```sfml EVERY 20 TICKS DO INPUT FROM source -- Check if source has more than 10 iron ingots IF source HAS GT 10 iron_ingot THEN OUTPUT TO dest1 END -- Compound conditions with AND/OR IF NOT source HAS > 20 stone AND source HAS GE 20 cobblestone THEN OUTPUT 20 TO dest2 END END -- Set qualifiers for multiple inventories with same label -- Given three "a" inventories: [5 stone], [5 stone], [10 stone] EVERY 20 TICKS DO -- OVERALL: checks total across all (default behavior) IF overall a HAS EQ 20 stone THEN END -- TRUE (5+5+10=20) -- EVERY/EACH: all must match IF every a HAS >= 5 stone THEN END -- TRUE IF each a HAS = 5 stone THEN END -- FALSE -- SOME: at least one must match IF some a HAS EQ 5 stone THEN END -- TRUE -- ONE: exactly one must match IF one a HAS = 10 stone THEN END -- TRUE -- LONE: zero or one must match IF lone a HAS = 10 stone THEN END -- TRUE END -- Else-if chains EVERY 20 TICKS DO IF a HAS GE 32 iron_ingot THEN INPUT 1 cobblestone FROM a ELSE IF a HAS GE 16 iron_ingot THEN INPUT 1 stone FROM a ELSE INPUT 1 red_sandstone FROM a END OUTPUT TO b END ``` -------------------------------- ### SFML Furnace Automation Program Source: https://context7.com/teamdman/superfactorymanager/llms.txt This SFML program automates the process of loading items into furnaces, managing fuel levels, and collecting smelted results. It utilizes input and output directives to interact with adjacent inventories and specifies the quantity and side for item transfers. The program is designed to run periodically based on game ticks. ```sfml NAME "Furnace Manager" EVERY 20 TICKS DO -- Load items to smelt INPUT FROM "to be smelted" OUTPUT 8 TO EACH furnace TOP SIDE FORGET -- Manage fuel, keep 1 in reserve INPUT FROM fuel OUTPUT RETAIN 1 TO EACH furnace BOTTOM SIDE FORGET -- Collect smelted results INPUT FROM furnace BOTTOM SIDE OUTPUT TO results END ``` -------------------------------- ### Tag Matching in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Explains how to filter items based on Minecraft tags using the WITH clause in SFML. This includes matching specific tags, using wildcards, omitting namespaces, and combining tag filters with other conditions. ```sfml EVERY 20 TICKS DO -- These are equivalent INPUT WITH #forge:gems FROM chest INPUT WITH TAG forge:gems FROM chest INPUT WITH TAG #forge:gems FROM chest -- Omit namespace to match all namespaces INPUT WITH #ingots FROM chest INPUT WITH TAG *:ingots FROM chest -- Tags with multiple path elements INPUT WITH TAG refinedstorage:disks/items/* FROM chest INPUT WITH #tools/*/*_matter FROM chest -- Match all remaining segments INPUT WITH #the_bumblezone:essence/** FROM chest -- Combine with other filters INPUT 3 RETAIN 5 WITH TAG #forge:ingots, 4 dirt, WITH #mineable/axe, stone, EXCEPT sand, gold_ingot FROM chest -- Exclude tags INPUT WITH NOT #needs_stone_tool FROM chest -- Boolean logic with tags INPUT WITH NOT #needs_stone_tool AND #ores/* FROM chest INPUT WITHOUT #needs_stone_tool AND #ores/* FROM chest OUTPUT TO other_chest END ``` -------------------------------- ### Timer Triggers in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Control when programs execute using various timing options. Supports basic tick-based triggers, global world clock triggers, timing offsets, and shorthand notations. Seconds can also be used as a unit for triggers. ```sfml -- Basic timer (20 ticks = 1 second) EVERY 20 TICKS DO END -- Use world clock instead of manager's internal clock EVERY 20 GLOBAL TICKS DO END -- Add timing offset EVERY 20 PLUS 1 TICKS DO END -- manager clock EVERY 20 GLOBAL PLUS 1 TICKS DO END -- global clock -- Shorthand notation EVERY 20+1 TICKS DO END -- manager clock EVERY 20G TICKS DO END -- global clock EVERY 20G+1 TICKS DO END -- global clock -- Seconds syntax EVERY 5 SECONDS DO END ``` -------------------------------- ### Restore Deleted File using Git Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/todo.md This command restores a specific file from a given commit hash into the current directory. It's useful for recovering accidentally deleted files during Git operations. ```powershell cd D:\Repos\Minecraft\SFM\repos2\1.20.3 git show 452215fb1:src/main/java/ca/teamdman/sfm/common/registry/SFMBlockCapabilities.java > platform\minecraft\src\main\java\ca\teamdman\sfm\common\registry\SFMBlockCapabilities.java ``` -------------------------------- ### Retention Policy in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Explains the use of the RETAIN keyword in SFML's INPUT and OUTPUT statements to maintain a minimum amount of items in source or destination inventories, preventing complete depletion or overfilling. ```sfml EVERY 20 TICKS DO -- Move all items except keep 1 in source INPUT RETAIN 1 FROM a OUTPUT TO b END EVERY 20 TICKS DO -- Move up to 25 items, but keep 1 in source INPUT 25 RETAIN 1 FROM a OUTPUT TO b END EVERY 20 TICKS DO INPUT FROM a -- Only fill destination until it has 20 items OUTPUT RETAIN 20 TO b END EVERY 20 TICKS DO INPUT 15 RETAIN 5 iron_ingot, 12 RETAIN 3 stone -- move 12 stone, keep 3 FROM a TOP SIDE OUTPUT 2 iron_ingot, 64 RETAIN 10 stone -- accept up to 64, max 10 in destination TO b END ``` -------------------------------- ### Handling Fluids and Resource Types in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Move fluids and other resource types beyond standard items. The default resource type is sfm:item. Fluids can be moved generically using 'fluid::' or specifically by type, with options for retaining quantities. ```sfml EVERY 20 TICKS DO -- Default resource type is sfm:item INPUT stone FROM a INPUT sfm:item:*:stone FROM a -- equivalent -- Move all fluids INPUT fluid:: FROM a OUTPUT fluid:: TO b -- Expands to: INPUT sfm:fluid:*:* FROM a -- Specific fluid INPUT fluid::water FROM a INPUT sfm:fluid:*:water FROM a -- equivalent -- Move fluids with retention INPUT fluid::water FROM source OUTPUT RETAIN 1000 fluid::water TO EACH tank END ``` -------------------------------- ### Rust Enum for Merge State Management Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/platform/cli/sfm-propagate-changes/README.md Defines the possible states for the change propagation process. This includes an idle state and a state to track merge conflicts, specifying the source and destination branches and their paths. ```rust enum State { Idle, MergingWithConflict { source: (BranchName, PathBuf), dest: (BranchName, PathBuf) } } ``` -------------------------------- ### Round Robin Distribution in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Distribute items evenly across multiple destinations using ROUND ROBIN. This can be applied by block (rotating through blocks with a specific label) or by label (alternating between different labels each execution). ```sfml EVERY 20 TICKS DO INPUT FROM source -- Rotate through blocks with "dest" label each execution OUTPUT 128 dirt TO dest ROUND ROBIN BY BLOCK END EVERY 20 TICKS DO -- Alternate between different labels each execution INPUT FROM "storage a", "storage b" ROUND ROBIN BY LABEL OUTPUT 8 bone_meal TO EACH dispenser END ``` -------------------------------- ### Milestone Cleanup Script Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md PowerShell script to clean up GitHub milestones after a release. This script helps in managing project issues and ensuring they are correctly closed. ```powershell pwsh -File ./platform/pwsh/milestone-cleanup.ps1 ``` -------------------------------- ### Item Filtering in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Details how to filter items for movement in SFML using item IDs, wildcard patterns, and exclusion lists. This allows for precise control over which items are processed. ```sfml EVERY 20 TICKS DO INPUT 5 stone, 3 iron_ingot, cobblestone, -- trailing comma is fine FROM a OUTPUT TO b END -- Wildcard pattern matching EVERY 20 TICKS DO INPUT *ingot* FROM a -- matches all items containing "ingot" OUTPUT ".*ore.*" TO b -- quoted patterns use full regex END -- Exclude specific items EVERY 20 TICKS DO INPUT *ingot* EXCEPT iron_ingot, gold_ingot FROM a INPUT EXCEPT cobblestone FROM z OUTPUT 5 EXCEPT copper_ingot TO b END -- Statement-level exclusion EVERY 20 TICKS DO INPUT *iron*, *copper* EXCEPT *block* -- excludes iron_block AND copper_block FROM chest OUTPUT TO chest2 END ``` -------------------------------- ### Redstone Triggers and Conditions in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Trigger programs based on redstone signals using the PULSE keyword for rising edges. Redstone signal levels can also be checked within conditional statements (IF) to control program flow. ```sfml -- Execute on rising edge of redstone signal EVERY REDSTONE PULSE DO INPUT FROM a OUTPUT TO b END -- Check redstone signal level in conditions EVERY 20 TICKS DO IF REDSTONE GE 2 THEN INPUT FROM a OUTPUT TO b END END ``` -------------------------------- ### LabelPositionHolder Data Source: https://github.com/teamdman/superfactorymanager/blob/1.19.2/docs/RELEASE_PROCESS.md This data format is used to associate labels with positions for the label gun in Super Factory Manager. It specifies the number of positions for each label. ```item-data a: 0 positions b: 0 positions ``` -------------------------------- ### Forget Statement for Input Management in SFML Source: https://context7.com/teamdman/superfactorymanager/llms.txt Clear accumulated inputs between operations within a trigger using the FORGET statement. This prevents inputs from previous operations within the same trigger cycle from affecting subsequent operations. It can clear all inputs or specific labeled inputs. ```sfml EVERY 20 TICKS DO INPUT FROM a OUTPUT 1 TO b -- Without FORGET, "a" input remains active INPUT FROM c OUTPUT TO d -- receives from both "a" AND "c" END EVERY 20 TICKS DO INPUT FROM a OUTPUT 1 TO b FORGET -- clears all accumulated inputs -- or: FORGET a -- clears specific label INPUT FROM c OUTPUT TO d -- receives only from "c" END ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.