Major dupe bug
FallenEagle1 opened this issue ยท 2 comments
This bug spawns from food items that give you back an "empty" item when consumed. The main example I've seen of this is with XL food's mod's items, but I think that other mods would have this issue. An example is drinking a coffee cup gives back an empty coffee cup. If you have one of these items in a sandwich, when you eat the sandwich you still get the empty cup back. This comes into the play when you can get multiple sandwiches from a single craft, and when you can get meta sandwiches.
Possible solution to this is to is to disable giving back items when consuming items. Ideally, when the first sandwich is crafted, the craft would give back the empty item (singular) but not sure how easily that can be added in.
Video quality not great, but should still be good to show this.
I'd need more examples to really identify an optimal solution, but in this case, this is due to the fact that the coffee item from XL Food manually places a new coffee cup into your inventory when it's eaten. And there's no good way for me to prevent this from happening. I could avoid calling that method entirely, but it's pretty vital for permeating food effects through to the sandwiches.
I think the easiest solution would be for XL Food to transfer the ItemFood#onFoodEaten
code to Item#onItemUseFinish
and call that similar to how ItemBucketMilk
does it.
In the meantime, I've made a minor adjustment that should give back the container item for foods that do have one when initially crafting the sandwich. That being said, the coffee from XL Food does not dictate a container item so it won't show up for that particular case.
I'll do some more looking to see if the problem persists among other mods, and if its just related to xl food, I might just blacklist the item in the mean time. Will pass on the info to their devs as well.
Its a round about way, but was finding players that would then smelt down the cups to then have a surplus of iron ingots. Interesting way to dupe, but it doesn't help balance for mod packs in my case. Based on what you mentioned, might not need any changes on your end, but will do some more looking.