-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from pog5/patch-1
Fix the sprint glitch which results in inconsistent health.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: pixelNightly <[email protected]> | ||
Date: Mon, 4 Dec 2023 16:11:36 +0200 | ||
Subject: [PATCH] Fix sprint glitch | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
index 23197384963b7f67e096eff18bf1809d36611923..57e6609368bf402ece1ca28b46fd1ef5813c7159 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
@@ -1422,7 +1422,8 @@ public abstract class LivingEntity extends Entity implements Attackable { | ||
player.setRealHealth(health); | ||
} | ||
|
||
- player.updateScaledHealth(false); | ||
+ this.entityData.set(LivingEntity.DATA_HEALTH_ID, player.getScaledHealth()); // Sprint glitch Fix by pafias | ||
+ // player.updateScaledHealth(false); // Commented out to fix sprint glitch | ||
return; | ||
} | ||
// CraftBukkit end |