Farmer's Delight

Farmer's Delight

77M Downloads

[1.16.4] Sound tests for instanceof rather than tooltype

noobanidus opened this issue ยท 3 comments

commented

Description
I was looking into adding compatibility for Mystical World knives when I noticed that the code below it, specifically for the sound event, checks instanceof rather than tooltypes.

As it's called from processItemUsingTool and has access to the recipe, presumably it could be converted to use the tool type instead?

Either way, now I understand what compat was missing, I'll hopefully be able to add it into the next version.

Steps to reproduce:
N/A

Expected behavior:
N/A

Screenshots
N/A

Mod list:
N/A (literally just from looking at the source code)

commented

I'll admit that method could use a cleanup, considering the cutting recipes can receive a sound ID now. ๐Ÿ˜…

I haven't actually given my knives a ToolType, as I wasn't sure if other modded knives would use "knife" as well, and/or the side effects of doing it. Perhaps it would make sense to have it in such case, or at the very least check for the tags instead.

Lemme know if you have more questions about integration! I'll take a look in the method later. ๐Ÿ‘

commented

I suppose an alternative and easier option that would allow for pack-makers to have some control over it would be to use tags instead of tooltypes.

commented

I changed the method to detect the tags instead of instanceof on commit a3484ec. Though it's not using ToolTypes just yet (this dot release fixes a more critical bug), I'll keep it on the checklist, as it may also help with Tetra Integration. ๐Ÿ‘