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

Craft special cases : handle custom recipes and not consumed items #222

Open
rom1504 opened this issue Mar 17, 2015 · 15 comments
Open

Craft special cases : handle custom recipes and not consumed items #222

rom1504 opened this issue Mar 17, 2015 · 15 comments
Labels
inventory new feature Stage2 promising idea, but needs more thinking before implementation

Comments

@rom1504
Copy link
Member

rom1504 commented Mar 17, 2015

Currently it is assumed that all the blocks used in a recipe are consumed (https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/inventory.js#L572).

It is not true for all recipes (see http://minecraft.gamepedia.com/Written_Book )

So it should be handled by mineflayer :

  • either by adding a consumed/not consumed in the recipes enum
  • either in figuring out whether the server send us the new crafting grid items (or absence of item)

Custom recipes are related to this consumption/not consumption

@roblabla
Copy link
Member

We should test the proxy with a bukkit plugin like http://dev.bukkit.org/bukkit-plugins/recipemanager/ to figure out how it's done.

@deathcap
Copy link
Member

Also consider "container" items, e.g., milk bucket's container = empty bucket, returned from crafting cake http://minecraft.gamepedia.com/Cake

@rom1504
Copy link
Member Author

rom1504 commented Mar 23, 2015

Yeah so.. I finally understoof what is "outShape" in recipes.json
inShape is the shape before crafting, outShape is the shape after crafting

So, it should be checked if there is an outShape there https://github.com/andrewrk/mineflayer/blob/master/lib/plugins/inventory.js#L572 and I think that will handle all the cases we are talking about in that issue.

@rom1504
Copy link
Member Author

rom1504 commented Mar 26, 2015

So, it would be nice to test if we can craft a cake. It that works, this issue is half-done.

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

Ok crafting a cake works.

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

Is it possible to get a "written book" by the creative inventory ? it doesn't seem there so I can't test whether that recipe would work.

@thejoshwolfe
Copy link
Contributor

creative api can probably give you everything, since it's how the normal client simply moves items around.

@deathcap
Copy link
Member

Also what about firework crafting recipes (according to http://minecraft.gamepedia.com/Fireworks "firework rocket is one of the few items in the game that cannot be taken directly out of a creative inventory") and item repair recipes (combining two damaged tools)

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

I meant "creative inventory" not creative API, ie I don't know how to give myself a written book in the actual game.
Edit: oh it doesn't look like in the wiki, but it's there. Its display name is "enchanted book".
And the recipe doesn't work with the enchanted book.
If someone knows how to do that recipe, please explain, I can't test it with mineflayer if I don't understand how to do it in the game.

I'll try the firework recipe.

"item repair recipe" is not an actual recipe, so it shouldn't be in the recipes.json, maybe it should be stored elsewhere or just computed an other way (the rule is " Two items of the same type and material can be placed anywhere on the crafting grid, and the result is a single repaired item. ") and there should be an other method than bot.craft to do it, maybe bot.repair or something.

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

crafting fireworks works.

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

I'd better have an automatic test for this though (see #239 (comment)) instead of testing manually.

@deathcap
Copy link
Member

I meant "creative inventory" not creative API, ie I don't know how to give myself a written book in the actual game.

You can use commands:

/give player minecraft:written_book 1 0 {author:'Player', title:'title1', resolved:1, generation:0, pages: ['hi']}

@rom1504
Copy link
Member Author

rom1504 commented Mar 29, 2015

Ok that worked.

That recipe is broken in mineflayer, the reason is this recipe has ingredients and "outIngredients", which is not handled by mineflayer (and minecraft-data).

see PrismarineJS/minecraft-data#10

@rom1504 rom1504 modified the milestone: 1.1.0 Mar 31, 2015
@rom1504
Copy link
Member Author

rom1504 commented Apr 3, 2015

Recipes with metadata (even the simplest one like "white" log --> "white" wood) are broken. The problem is likely in the data, fixing this depends on PrismarineJS/minecraft-data#7

Also : it would be nice to know which recipe is broken and which is not (see #239)

@rom1504 rom1504 added the Stage2 promising idea, but needs more thinking before implementation label Feb 6, 2021
@Matitron
Copy link

with 1.17 (note:it may have happened before 1.17) but containers like bottles that are used eg: if i make a recipie that turns a honey bottle into a potato the bottle will remain but we still can't control witch item is consumed but its a start i suppose :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inventory new feature Stage2 promising idea, but needs more thinking before implementation
Projects
None yet
Development

No branches or pull requests

5 participants