
[Bug] citizen's saturation is not increases when food stacksize is 1
gisellevonbingen opened this issue ยท 1 comments
Is there an existing issue for this?
- I have searched the existing issues.
Are you using the latest MineColonies Version?
- I am running the latest beta/release version of MineColonies for my Minecraft version.
I am also running the latest versions of other mods that are part of my problem.
Did you check on the Wiki? or ask on Discord?
- I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.
What were you playing at the time? Were you able to reproduce it in both settings?
- Single Player
- Multi Player
Minecraft Version
1.20.1
MineColonies Version
1.20.1-1.1.800
Structurize Version
1.20.1-1.0.759
Related Mods and their Versions
No response
Current Behavior
- Does not increases citizens's saturation.
- But food item was consumed.
Expected Behavior
- Increases citizens's saturation.
Reproduction Steps
- Check citizens's saturation first.
- Give just a food what stack size is 1 to citizen.
- Watch citizen eat it.
- Check saturation again.
2025-01-31.17-57-58.mp4
Logs
No needed.
Anything else?
minecolonies/src/main/java/com/minecolonies/api/util/ItemStackUtils.java
Lines 864 to 866 in e9d793a
The cause of this bug is foodStack.finishUsingItem
was called before calling FoodUtils.getFoodValue
.
During the process of calling ItemStack#finishUsingItem
, LivingEntity#eat
is called internally, which shrink the count of ItemStack by 1.
If the food ItemStack's count was 1, shrinked size will be 0, so ItemStack will be processed like a empty.
Finally, the return value of Food Utils.get Food Value
became 0.
Footer
Viewers
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.