forked from gnembon/carpetmod
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
smoothClientAnimations implementation
tho nobody uses carpet client 1.13 but it must be there
- Loading branch information
1 parent
cdffd02
commit 3e9ceac
Showing
2 changed files
with
84 additions
and
4 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
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,26 @@ | ||
--- a/net/minecraft/util/Timer.java | ||
+++ b/net/minecraft/util/Timer.java | ||
@@ -1,5 +1,7 @@ | ||
package net.minecraft.util; | ||
|
||
+import carpet.helpers.TickSpeed; | ||
+import carpet.settings.CarpetSettings; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
|
||
@@ -20,7 +22,14 @@ | ||
|
||
public void updateTimer(long p_74275_1_) | ||
{ | ||
- this.elapsedPartialTicks = (float)(p_74275_1_ - this.lastSyncSysClock) / this.tickLength; | ||
+ // Carpet smoothClientAnimations | ||
+ float tickLength = this.tickLength; | ||
+ if (CarpetSettings.smoothClientAnimations && TickSpeed.process_entities) | ||
+ { | ||
+ tickLength = Math.max(tickLength, TickSpeed.mspt); | ||
+ } | ||
+ | ||
+ this.elapsedPartialTicks = (float)(p_74275_1_ - this.lastSyncSysClock) / tickLength; | ||
this.lastSyncSysClock = p_74275_1_; | ||
this.renderPartialTicks += this.elapsedPartialTicks; | ||
this.elapsedTicks = (int)this.renderPartialTicks; |