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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The following features are already working:
- [X] breaking and placing blocks
- [X] block interaction (right-clicking, e.g., to open doors)
- [X] player inventory
- [X] crafting, both 2x2 and 3x3 (however, not all recipes are supported, yet)
- [X] chat
- [X] commands (in-game and via an interactive console)
- [X] configuration via server.properties
Expand Down
1 change: 1 addition & 0 deletions src/copybooks/DD-CALLBACK-WINDOW-SET-SLOT.cpy
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
01 LK-INDEX BINARY-SHORT.
01 LK-SLOT.
COPY DD-INVENTORY-SLOT REPLACING LEADING ==PREFIX== BY ==LK==.
01 LK-SYNC-REQUIRED BINARY-CHAR UNSIGNED.
15 changes: 15 additions & 0 deletions src/copybooks/DD-RECIPES.cpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*> --- Copybook: crafting recipes ---

78 RECIPES-SHAPELESS-CAPACITY VALUE 1000.

01 RECIPES EXTERNAL.
02 RECIPES-SHAPELESS.
03 RECIPES-SHAPELESS-COUNT BINARY-LONG UNSIGNED.
*> For efficient lookup, shapeless recipes store their ingredients sorted by item protocol ID (descending),
*> where ingredients occuring multiple times are repeated, and everything is padded with trailing zeroes.
03 RECIPE-SHAPELESS OCCURS RECIPES-SHAPELESS-CAPACITY TIMES.
04 RECIPE-SHAPELESS-INPUTS.
05 RECIPE-SHAPELESS-INPUT OCCURS 9 TIMES BINARY-LONG UNSIGNED.
04 RECIPE-SHAPELESS-OUTPUT.
05 RECIPE-SHAPELESS-OUTPUT-ID BINARY-LONG UNSIGNED.
05 RECIPE-SHAPELESS-OUTPUT-COUNT BINARY-LONG UNSIGNED.
Loading
Loading