Closed LTCatt closed 2 weeks ago
I can't really test this. There's no way to run fabric mods in a forge dev environment. Do the items actually give 20 health or is just visual? Did you try eating them?
hmm let me see if there's any other way to reproduce
I investigated a bit more and this should be because Better End is using the same instance of FoodProperties when registering food, causing one to be modified when the other is modified.
public final static Item CAVE_PUMPKIN_PIE = registerEndFood("cave_pumpkin_pie", Foods.PUMPKIN_PIE);
public static Item registerEndFood(String name, FoodProperties foodComponent) {
return getItemRegistry().registerFood(BetterEnd.makeID(name), foodComponent);
}
Perhaps this can be circumvented by creating a clone of the FoodProperties and making changes to the cloned instance when it is modified?
So BetterEnd is needed?
Yes, I can't reproduce this with other mods.
I investigated a bit more and this should be because Better End is using the same instance of FoodProperties when registering food, causing one to be modified when the other is modified.
public final static Item CAVE_PUMPKIN_PIE = registerEndFood("cave_pumpkin_pie", Foods.PUMPKIN_PIE); public static Item registerEndFood(String name, FoodProperties foodComponent) { return getItemRegistry().registerFood(BetterEnd.makeID(name), foodComponent); }
Perhaps this can be circumvented by creating a clone of the FoodProperties and making changes to the cloned instance when it is modified?
Then this is exactly the problem. It's up to them to use a new instance of the food component.
Versions:
What Happens:
It looks like
IdTagMatcher
did something weird. https://github.com/Insane96/IguanaTweaksReborn/blob/29d1693243c807332d9d7aab9270ce26ba8822c9/src/main/java/insane96mcp/iguanatweaksreborn/module/hungerhealth/fooddrinks/CustomFoodProperties.java#L20Config:
\config\iguanatweaksreborn\Hunger & Health\Foods & Drinks\food_properties.json