murphy-slaw / staminafortweakers

MIT License
0 stars 0 forks source link

Mods that break multiple blocks at once make stamina unable to regenerate #7

Closed makumaku1974 closed 4 months ago

makumaku1974 commented 4 months ago

I have mods like Falling Tree, and Just Hammers which you know they automatically depletes your stamina quickly.

2024-06-22_21 01 38 2024-06-22_21 05 32

makumaku1974 commented 4 months ago

Should i check logs?

murphy-slaw commented 4 months ago

Logs would be helpful. Can you also post your config/staminafortweakers.json5 file from the instance?

makumaku1974 commented 4 months ago

Actually the stamina is able to regen when it breaks another block LMFAO...

makumaku1974 commented 4 months ago

2024-06-22_21 16 21

murphy-slaw commented 4 months ago

I think I know what is going on here. I set a flag that says "the player is mining, consume stamina" when you begin attacking a block, and I unset it when you stop or the block breaks. In vanilla, only one block can ever be mined at a time. These tools break multiple blocks at a time and it is probably messing with the logic in some way that leaves the flag set.

Breaking another block resets the flag.

I'll test out this theory with Just Hammers installed and see if I can come up with a fix.

makumaku1974 commented 4 months ago

Here is the demo. https://github.com/murphy-slaw/staminafortweakers/assets/129804277/fdfd25c0-40b1-4cb2-8fc9-9b02988c846b

makumaku1974 commented 4 months ago

I think I know what is going on here. I set a flag that says "the player is mining, consume stamina" when you begin attacking a block, and I unset it when you stop or the block breaks. In vanilla, only one block can ever be mined at a time. These tools break multiple blocks at a time and it is probably messing with the logic in some way that leaves the flag set.

Breaking another block resets the flag.

I'll test out this theory with Just Hammers installed and see if I can come up with a fix.

The Just Hammers is actually persistent and cant reset since it breaks multiple at once but with the Falling Trees or any Tree Capitator mods out there can actually reset the Flag. Since breaking one block resets the flag.

murphy-slaw commented 4 months ago

This fix is in 1.0.9, which I just posted to CurseForge and Modrinth.