-
Notifications
You must be signed in to change notification settings - Fork 162
Implement dynamic recipes system with decorated pot support #1130
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
Implement dynamic recipes system with decorated pot support #1130
Conversation
TwistedAsylumMC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me apart from 2 minor things. Are we supposed to be sending the dynamic recipe UUIDs to the client (maybe we already do?), or does this work without them if we're not already sending them
|
@TwistedAsylumMC |
|
Alright that sounds good to me. Does the client just magically know these recipes exist? |
The client doesn't need to know these dynamic recipes exist in the traditional sense. That's the whole point of dynamic recipes. For static recipes, yes - the client receives them via CraftingData packet and can show them in the recipe book. For dynamic recipes (decorated pots, banner copying, etc.), the client has no prior knowledge of them. The player just places items in the crafting grid,
So dynamic recipes work precisely because the client doesn't know about them - they're only validated server-side when the player attempts to craft. |
Summary
Adds support for dynamic recipes - recipes where the output depends on the specific items used in crafting, not just their types. Implements decorated pot crafting as the first dynamic recipe.
Changes
New
DynamicRecipeinterface (recipe/dynamic.go)DynamicRecipeinterface withMatch(input []Item) (output []item.Stack, ok bool)methodDecoratedPotRecipethat creates pots with pottery sherd/brick patternsDecorated pot crafting logic
PotDecoration()(sherds or bricks)Handler integration (
session/handler_crafting.go)tryDynamicCraft()fallback when static recipes don't matchtimesCraftedto minimum available stack count across slotsCraftRecipeandAutoCraftRecipeactionsRecipe registration
DynamicRecipes()registry functionImplementation details
Dynamic recipe matching:
Security considerations:
Future dynamic recipes
This system enables implementation of other dynamic recipes:
Test plan
Closes #592
IssueHunt Summary
Referenced issues
This pull request has been submitted to: