Skip to content

Commit

Permalink
Merge pull request #13 from pog5/patch-1
Browse files Browse the repository at this point in the history
Fix the sprint glitch which results in inconsistent health.
  • Loading branch information
Dreeam-qwq authored Dec 4, 2023
2 parents 597cae6 + f3f24de commit b79d257
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions patches/server/0041-Fix-sprint-glitch.patch
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

0 comments on commit b79d257

Please sign in to comment.