Skip to content

Conversation

@MSKatKing
Copy link
Contributor

@MSKatKing MSKatKing commented Nov 25, 2025

Implements crafting with the survival inventory crafting grid. This does not implement a crafting table as those UIs have not been implemented yet. However, functionality to get a recipe from a 3x3 crafting grid does exist (ferrumc_core::crafting::get_recipes_from_3x3) so crafting tables should be fairly simple to implement once we get there.

When the survival crafting grid is updated, the code will search through recipes to find ones that match the current grid. If one is found, it will update the output to reflect that.

To make this work I had to implement basic inventory syncing. My code just assumes that the client is telling the truth and updates the player's inventory in whatever way the client tells it to. While for now this is fine, when we implement other containers (or even just the player inventory better) we want to ensure that changes are valid. Additionally, the crafting grid just gets cleared when the player closes their inventory. Again, this should be changed in later implementations of the inventory.

This PR does NOT add recipe searching functions for any other crafting type (smelting, blasting, campfire cooking, smithing, etc). It only implements the player's survival crafting grid (with the aforementioned functionality to support 3x3 grids).

If this PR gets merged I'm going to open issues for the inventory syncing problem so if someone else wants to tackle it, they can.

Copy link
Member

@Sweattypalms Sweattypalms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I've reviewed your PR. Please have a look at the comments.

@Sweattypalms
Copy link
Member

lgtm, cheers.

@Sweattypalms Sweattypalms merged commit 1d2dcf1 into ferrumc-rs:master Nov 27, 2025
6 checks passed
@MSKatKing MSKatKing deleted the feature/crafting branch November 28, 2025 01:00
@MSKatKing MSKatKing mentioned this pull request Nov 28, 2025
3 tasks
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