Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-279725

MC-152728 hasn't reverted properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 25w04a
    • None
    • Unconfirmed
    • (Unassigned)

      The Bug:

      The fix for the bug where the player continues sprinting when performing actions that slow them down was partially reverted, but some changes were left behind.

      Steps to Reproduce:

      1. Start sprinting and have blindness.
      2. Verify that the player stops sprinting.
      3. Start sprinting, and be in fall flying mode, not be underwater.
      4. Verify that the player stops sprinting.
      5. Start sprinting and be a passenger in a vehicle that does not allow sprinting.
      6. Verify that the player stops sprinting.

      Observed Behavior:

      The player stops sprinting when having blindness, being in fall flying mode and not being underwater, or being a passenger and the vehicle. However, the player should not stop sprinting when performing these actions if the fix is fully reverted.

      Expected Behavior:

      The player should not stop sprinting when having blindness, being in fall flying mode and not being underwater (flying with elytra especially), or being a passenger and the vehicle. The player should continue sprinting in these situations, just like they do when moving slowly, using an item, blocking with a shield, charging a bow or crossbow, preparing to throw a trident, using a goat horn.

      Code Analysis:

      The `shouldStopSprinting` method should be removed permanently, as it is no longer needed. This method is currently defined as:

      net.minecraft.client.player.LocalPlayer.java
      public class LocalPlayer extends AbstractClientPlayer {
         ...
         private boolean shouldStopSprinting() {
            return this.hasBlindness() || this.isFallFlying() && !this.isUnderWater() || this.isPassenger() && !this.vehicleCanSprint(this.getVehicle());
            }
         ...

      Additionally, the call to `shouldStopSprinting` in the `aiStep` method should be removed:

      public class LocalPlayer extends AbstractClientPlayer {
        ...
        public void aiStep() {
           ...
           if (this.shouldStopSprinting())
           { this.setSprinting(false); }
           ...
      

      By removing these elements, the game will behave as it did before the bug was fixed, and the player will continue sprinting when performing actions that slow them down.

       

            Unassigned Unassigned
            TeyRine Riflusso
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: