Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement shapeless 2x2 and 3x3 crafting recipes #314

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

meyfa
Copy link
Owner

@meyfa meyfa commented Jan 26, 2025

Recipes are loaded from the default datapack on startup. They are transformed into a serialized format, which is also easy to do for a crafting grid inside the player inventory or crafting table GUI, and hence allows for fast comparison of the crafting grid against all recipes.

Quite a lot of recipes are now possible to craft, such as planks from logs or dying wool or beds, but many other recipes are shaped and as such not possible yet. Startup time also increases substantially due to the increase in data that must be read and loaded, and should be optimized as future work.

Recipes are loaded from the default datapack on startup. They are transformed
into a serialized format, which is also easy to do for a crafting grid inside the
player inventory or crafting table GUI, and hence allows for fast comparison
of the crafting grid against all recipes.

Quite a lot of recipes are now possible to craft, such as planks from logs or
dying wool or beds, but many other recipes are shaped and as such not
possible yet. Startup time also increases substantially due to the increase in
data that must be read and loaded, and should be optimized as future work.
@meyfa meyfa merged commit 321f621 into main Jan 26, 2025
3 checks passed
@meyfa meyfa deleted the feat/shapeless-crafting branch January 26, 2025 22:00
meyfa added a commit that referenced this pull request Feb 1, 2025
Follow-up to #314. This patch implements parsing of recipe files with the
type "minecraft:crafting_shaped", including very complex recipes such as the
barrel (no, really - due to there being 12 types of wood in the game, there
are 12^8 = 429,981,696 ways to craft a barrel!), along with the required
checks when crafting grid slots are changed.

This means we now support 932 out of 978 crafting recipes, with the
remaining ones needing specialized implementations, such as keeping NBT
data when coloring shulker boxes or repairing tools by combining them.

In any case, it's now possible to go from logs to planks to a crafting table, and
also towards sticks and then torches or even a cobblestone pickaxe.
meyfa added a commit that referenced this pull request Feb 2, 2025
Follow-up to #314. This patch implements parsing of recipe files with the
type "minecraft:crafting_shaped", including very complex recipes such as the
barrel (no, really - due to there being 12 types of wood in the game, there
are 12^8 = 429,981,696 ways to craft a barrel!), along with the required
checks when crafting grid slots are changed.

This means we now support 932 out of 978 crafting recipes, with the
remaining ones needing specialized implementations, such as keeping NBT
data when coloring shulker boxes or repairing tools by combining them.

In any case, it's now possible to go from logs to planks to a crafting table, and
also towards sticks and then torches or even a cobblestone pickaxe.
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.

1 participant