matthe815 / matthews-difficulty-mod

A recreation of the now discontinued Tough as Nails, with additional quality-of-life features, and implementations from Extra TAN
MIT License
1 stars 1 forks source link

[BUG] Cannot jump when stamina is disabled in config #33

Closed ScottCowe closed 2 years ago

ScottCowe commented 2 years ago

Describe the bug I disables stamina in the config files, and yet in a survival world I often find I cannot jump

To Reproduce Steps to reproduce the behavior:

  1. Change stamina settings as follows `"stamina settings" {

    Determines if the player will be punished with a slowness effect when stamina bottoms out.

        # DEFAULT: TRUE
        B:"Apply Slowness On Depletion"=false
    
        # Determines whether or not stamina will be disabled when on the peaceful difficulty.
        # DEFAULT: FALSE
        B:"Disable Peaceful Stamina"=false
    
        # Determines whether or not stamina will be disabled.
        # DEFAULT: FALSE
        B:"Disable Stamina"=true
    
        # Change the amount of stamina that each action takes.
        # To modify an action, fill a new value into the array with the format of {ACTION}:{STAMINA_REQUIRED}
        # Negative numbers are accepted.
        # List of applicable actions: JUMPING, RUNNING, MINING, ATTACKING
        # Enter a range between -100 - 100
        S:"Stamina Depletion" <
         >
    }`
  2. Jump around a bit in a survival world

Expected behavior I should be able to jump

Details:

matthe815 commented 2 years ago

Thank you for your report. I will investigate the issue and make a patch as soon as possible. If you have more information you can add, or additional bug reports, please feel free to post them.

matthe815 commented 2 years ago

I have identified the issue. If you're curious it's a result of canceling the jump before checking any special conditions.

See Below: https://github.com/matthe815/matthews-difficulty-mod/blob/eeda99311c259a6ddf74c8f57a5b247fe608eda5/src/main/java/difficultymod/events/LivingEvent.java#L164-L169

I will soon roll out a patch for this issue.

matthe815 commented 2 years ago

This bug is now fixed and pushed to the master branch. Thank you!

Cinamonfire commented 2 years ago

Please add this patch for the next release of this mod