Infinity Ham if equipped in backpack with feeding upgrade
C0WB0Y-Ducky opened this issue · 4 comments
Versions:
Relics: 0.9.03
Sophisticated Backpacks: 3.20.17
NeoForge 1.21
Modpack: Craftoria 1.5.0
Observed Behavior:
If the Infinity Ham is tagged is in a backpack with a feeding upgrade, the backpack does not see it as food, so will not auto feed.
Expected Behavior:
The Infinity Ham to be eaten straight from the backpack.
Steps to Reproduce:
Create a Backpack, add either feeding upgrade, place infinity ham inside backpack. Then go to the filter for the upgrade, you are unable to place it in the filter to allow/block. If nothing is blocked you do not eat. Finally lose some saturation and test with another piece of food.
I also have this problem. In 1.18.2
Mod pack: Chroma Endless 2 (latest version)
I'm not sure if this is the correct place
This is the logic from the Sophisticated mods:
The item needs to be edible and have food properties
The relic item isn't a food item though, it's a custom item which feeds the player on right click
Let's say you mixin to bypass the isEdible check, you'd then need to:
return with InteractionResult.CONSUME if startUsingItem is triggered
At this point the feeding wrapper calls ForgeEventFactory.onItemUseFinish (or EventHooks.onItemUseFinish for 1.21) - if an item is edible thats when LivingEntity#eat is triggered - but thats not the case for the relic item
So you either add another mixin point to eat the relic item here, or you implement finishUsingItem for the relic item and potentially trigger 1 tick of eating it (if it has charges left)
Instead of a mixin to bypass the check you might be able to return custom food properties when they're queried and implement a custom isEdible check depending on charges left
Then skip the super call on use to not trigger the vanilla eating logic