alRex-U / ParCool

A Minecraft Forge Mod for action of Cool Parkour
GNU General Public License v3.0
41 stars 30 forks source link

[1.18.2] use_hanger_instead does not work #232

Closed benjaminiserman closed 3 months ago

benjaminiserman commented 4 months ago

Summary When use_hanger_instead is set to true, neither hunger nor stamina is consumed by any Parcool ability.

Running Environment

Detail When use_hanger_instead is set to true, neither hunger nor stamina is consumed by any Parcool ability.

Stamina.java#72 calls player.causeFoodExhaustion in order to apply food exhaustion. That function checks !this.abilities.invulnerable && !this.level.isClientSide before calling this.foodData.addExhaustion(p_36400_);. I have debugged this myself: while playing both singleplayer and hosting LAN, this.level.isClientSide is true, preventing addExhaustion from being called. I have not tested this in online multiplayer. I'm not very familiar with Minecraft modding so I'm not sure why this is the case, otherwise I'd PR it for you myself. Replacing player.causeFoodExhaustion with player.foodData.addExhaustion appears to work as a stop-gap solution, however after reviewing this page I believe that solution may cause issues with multiplayer.

Additional Data I have tested this both with my full modpack, with only Parcool and Appleskin mods, and with only Parcool. The issue seems to persist across all three.

alRex-U commented 4 months ago

Thank you for reporting.

I'll fix it as soon as possible.

benjaminiserman commented 4 months ago

Thank you! I'd love to know what's causing this issue once you figure it out—I'm trying to become more familiar with MC modding 🙂