Lance5057 / Butchercraft

Other
10 stars 7 forks source link

`HookRecipe` returns a `null` item stack instead of `ItemStack.EMPTY` #50

Closed alcatrazEscapee closed 1 year ago

alcatrazEscapee commented 1 year ago

Here:

https://github.com/Lance5057/Butchercraft/blob/1f1b37f3eaef3dbc85d64e1bc48b89a70b6927f6/src/main/java/com/lance5057/butchercraft/workstations/recipes/meathook/HookRecipe.java#L51-L54

The method being overridden is not annotated @Nullable, it is by-default annotated not-null by mojang's convention and being an ItemStack, it is strongly preferred that you don't return null, rather instead use ItemStack.EMPTY here.

Reason being, some mods (hello!) like to iterate over all recipes, and call .getResultItem(), and expect, given it's an ItemStack returned from a non-null method, to in fact be non-null.

Thanks!