terrarium-earth / Heracles

A tree style questing mod allowing creators to set completable quests for their users
MIT License
35 stars 19 forks source link

[Bug]: Recipe Task completes upon Recipe Unlock rather than Crafting of Item #120

Closed chronosacaria closed 1 year ago

chronosacaria commented 1 year ago

Bug Description

When using the Recipe Task to complete a task upon crafting an item, the current implementation is triggering upon the unlocking of how to craft a recipe (see vanilla toast implementation) rather than upon the required item being crafted. This appears to be due to hooking in to ServerPlayerEntity#triggerRecipeCrafted rather than Item#onCraftedBy. Given the current nomenclature that is used, the Recipe Task was understood to trigger upon crafting an item via its recipe. Whilst this might be a misunderstanding on our part, it is my suggestion that either the nomenclature be changed to be more clear or the mixin targeted method be changed to the aforementioned suggestion.

How to Reproduce?

  1. Create a Recipe Task Quest
  2. Gather the ingredients needed to craft the item in the task
  3. Gain completed task without crafting the item

Expected Behavior

The task should trigger when the item is crafted via its recipe, rather than when the requisite ingredients are gathered.

Version

1.0.5

Mod Loader Version

1.20.1

Mod Loader

Fabric

Logs or additional context

No response

Code of Conduct

ThatGravyBoat commented 1 year ago

I just fixed this it was using the recipe unlock method instead of trigger crafted, trigger crafted is correct see https://github.com/terrarium-earth/Heracles/commit/3160cb3e5c30872820964f061b10423d4a62f10a