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

Update retrieval tasks that don't consume items when crafting is done #133

Open
kmoulins opened this issue Jan 3, 2025 · 1 comment
Open

Comments

@kmoulins
Copy link

kmoulins commented Jan 3, 2025

when crafting an item, if it is used in a retrieval task but you immediately use it for another recipe without closing the crafting table, it doesn't count towards the completion.
e.g. you have a quest that requires planks and one that requires sticks, if you use your log to craft planks and immediately craft sticks with the planks, the plank quest will not be completed.

alternatively, quests could be checked when the player inventory is modified for basically the same result.

@kmoulins
Copy link
Author

kmoulins commented Jan 8, 2025

initial findings :

  • using itemCraftedEvent works but only if shift+click is used to send it directly to the inventory, and it is called multiple times in a few cases (shift+right click to get a stack on the cursor, and vanilla crafting bench calling twice) so it needs to be scheduled.
  • using player.openContainer allows also getting whatever is in the currently opened inventory. (e.g. for crafting table-like blocks with inventories.)
  • a function that does the same job as TaskRetrieval.detect but takes a list of itemsStacks for each player or just directly uses player.openContainer and whatever the last crafted item was (clearing it after) might be the easiest way to do that.

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

No branches or pull requests

1 participant