codetaylor / artisan-worktables-1.12

Themed worktables with a tool slot.
Other
17 stars 6 forks source link

ItemCraftedEvent does not actually receive the crafted ItemStack #237

Open tuxmonkey opened 4 years ago

tuxmonkey commented 4 years ago

The ItemStack associated with the ItemCraftEvent for the tables does not appear to be the actual ItemStack that is a result of the crafting. Subscribing to the event and attempting to modify it in any way does nothing.

Example:

public static void onCraftItem(ItemCraftedEvent event)
{
        ItemStack stack = event.crafting;
        if (!stack.isEmpty()) {
            stack.setStackDisplayName("Test Item");
        }
}

With a vanilla crafting table this triggers fine and the display name for the stack is changed but with the artisan tables the event triggers but no modifications actually take effect.

codetaylor commented 4 years ago

You're correct! :)

This was an intentional design decision, but I don't remember the reasoning behind the decision right now. I'll dig into it when I have time, and if I can't find a reason to keep it the way it is, I'll open up the item stack for modification.