Skip to content

Refactor to JSON and enhance crafting/smelting logic#49

Open
40476 wants to merge 28 commits intoStorehaus:masterfrom
40476:master
Open

Refactor to JSON and enhance crafting/smelting logic#49
40476 wants to merge 28 commits intoStorehaus:masterfrom
40476:master

Conversation

@40476
Copy link
Copy Markdown
Contributor

@40476 40476 commented Feb 8, 2026

Took me a while but i got it figured out, would love to see some feedback in case i missed something.

40476 added 14 commits February 7, 2026 19:09
Update json module import paths from "json" to "lib/json" in crafting.lua and add missing json requires in furnace.lua and grid.lua to fix module loading issues.
Remove unused bfile alias and struct definitions for string_uint16_map and reserved_items that were no longer referenced in the codebase.

refactor(grid): simplify recipe requirement caching logic

Simplify the recipe requirement caching logic by removing unnecessary nested loops and directly accessing recipe items. Also remove redundant saveGridRecipes call.
Restructured the tag processing logic improving readability and maintainability. Added comprehensive tag resolution with nested tag expansion, enhanced error handling, and better integration with the existing recipe processing pipeline. The changes ensure more accurate item tag mapping and improved compatibility with Minecraft's tag system.
- Refactored tag resolution logic to consolidate inventory peripheral and alias lookups
- Improved candidate gathering using dictionary to prevent duplicates
- Added furnace recipe loading functionality from recipes.json
- Enhanced recipe management with proper craftable list updates
- Fixed version number to 1.4.5
Fixed item selection logic to prioritize items we already have or can craft, instead of blindly picking the first option. Also fixed grid recipe requirement caching to properly handle integer IDs as string keys in JSON objects.
…ssues

Fixed several critical bugs in the crafting module:
- Corrected simulation chain handling to properly return root node instead of nil
- Fixed job ID assignment to use root.jobId instead of nil
- Resolved job management logic to prevent duplicate job creation and ensure proper cleanup
- Fixed job status tracking to correctly handle "running" state transitions
- Corrected job removal logic to use job ID instead of name for proper cleanup
- Fixed job status updates to use correct job ID references

These changes ensure crafting chains are properly simulated, jobs are correctly managed throughout their lifecycle, and the system maintains accurate state tracking.
…dling

Fixed two issues:
1. `selectBestFromList` now properly resolves tag references (#logs) to specific items before checking inventory and crafting availability
2. Grid recipe storage now supports multiple recipes per name (e.g., Stick from Planks OR Bamboo) by storing recipes as arrays instead of single entries
…workflow

Renamed the script from gen_bins.py to gen_recipes.py to better reflect its purpose of generating recipe data. Added automatic download functionality to fetch the latest Minecraft server jar from Mojang's API instead of requiring manual download. Created a new GitHub Actions workflow (gen_recipes.yml) that runs the script and automatically commits recipe updates when changes are detected.
40476 added 6 commits February 8, 2026 12:59
… resilience

- Removed unused bfile.lua from installer
- Enhanced directDisposalHandler with pre-disposal verification to prevent threshold violations
- Added pcall wrapper around disposal requests to prevent module crashes from library errors
- Improved logging clarity and reduced verbosity in disposal pattern matching
- Fixed potential race condition where item counts could change between threshold check and disposal
…iability

- Removed bfile.lua from installer configuration as it's no longer needed
- Enhanced disposal module with better error handling and race condition prevention
- Added verification checks before disposal operations to prevent threshold violations
- Implemented pcall protection around disposal requests to prevent module crashes
- Improved logging for better debugging and monitoring of disposal operations
Added a workaround to split 64-item stack transfers into two separate operations (63 + 1) to bypass a library bug that causes incorrect item movement when pushing exactly 64 items at once.
…nction

- Fixed installer.lua to prevent running default menu after child installer completes
- Removed unused waitForTransfer function from inventory.lua
- Added main loop for post-install actions with reboot/install more options
Fixed a bug in the inventory transfer function where items with stack sizes of 16 or 64 were not being transferred correctly. The workaround that previously only handled 64-stack items has been extended to also handle 16-stack items by splitting the transfer into two moves to bypass a library bug.
@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Feb 8, 2026

@SethGamer1223 I'm kind of lost here, I've been trying to figure out why suddenly item transfers dont work properly
image
image
each of those is a seperate transfer.

@SethGamer1223
Copy link
Copy Markdown
Contributor

Seems to be that AIL located in the repository:
https://github.com/ShrekshellraiserCC/abstractInvLib
is broken but the one from the gist:
https://gist.github.com/ShreksHellraiser/57ef0f52a93304a17a9eaea21f431de6
does still work.

@SethGamer1223
Copy link
Copy Markdown
Contributor

I have merged a fix in #50 the problem should be resolved from my testing

@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Feb 9, 2026 via email

@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Feb 9, 2026

the main issue i had with the gist AIL was crafts and furnaces not running at all and/or requiring a server restart every time i wanted to run a craft.
(still have not had a chance to re-test the old AIL lib yet)

@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Feb 9, 2026

@SethGamer1223 Confirmed working, this is ready to merge. No clue what broke it originally either...

@SethGamer1223
Copy link
Copy Markdown
Contributor

When creating your own grid recipes it appears that they get cleared after the server is restarted.

@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Feb 15, 2026

Got it, unfortunately it may be a while until I can fix it since my desktop is not currently operational.

@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Mar 17, 2026

For any of the necro-posting victims: I'm deeply sorry if this brings back memories of your old github account 🤣. I do plan to tidy this PR up in a few days once I get my computer up and running again. But until then I thought it might be a good idea to let y'all know this is being fixed.

Added automatic saving of grid recipes to recipes/recipes.json file whenever recipes are added, removed, or modified. The saveGridRecipes function converts grid recipe format to standard crafting format and ensures the recipes directory exists before writing.
@40476
Copy link
Copy Markdown
Contributor Author

40476 commented Mar 27, 2026

@SethGamer1223 Ready to test

EDIT: there do appear to be some issues due to a misplaced crafting check so I am working on that

40476 added 6 commits April 3, 2026 15:03
Introduce a new farmer turtle client script that automates crop harvesting
and planting in rectangular farms. Integrates natively with CC-MISC by
pushing harvested items down and pulling seeds from the inventory below
through modemLib.

Features interactive first-run setup for farm dimensions (length/width),
starting direction, sleep timer, and fuel management. Uses GPS for precise
navigation and includes automatic refueling by requesting fuel items from
the CC-MISC inventory when levels are low.

Placement requires the turtle to rest on a modem/inventory block facing the
first crop row. The script handles obstacles like entities and maintains a
fuel buffer for return trips.
Added a new line graph display option to visualize usage data over time. This includes:
- Added 'line' as a new display style option
- Implemented configurable update intervals for line graphs
- Added color customization for line graphs in both light and dark themes
- Created history tracking functionality to store and retrieve usage data
- Implemented continuous monitoring at specified intervals
- Added dynamic history management based on monitor width

The line graph mode provides a time-series visualization of resource usage, making it easier to identify trends and patterns in the data.
This commit introduces a secure terminal wrapper that provides password protection for the terminal application. The wrapper fetches configuration from a server, implements an inactivity lock screen, and prevents unauthorized access to the terminal. Key features include:

- Secure configuration retrieval from server with validation
- Password-protected lock screen with visual feedback
- Inactivity timeout mechanism
- Event filtering to prevent bypassing security
- Clean integration with existing terminal application

The implementation ensures that the terminal remains secure even if left unattended, with automatic locking after a configured period of inactivity.
- Add password module (passwd.lua) for server authentication
- Implement secure access terminal with enhanced security features
- Create farmer turtle client for automated farming operations
- Update installation options to include new components
Added condition to only prompt for lineInterval when style is set to 'line', preventing unnecessary prompts for other graph styles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants