Skip to content

Commit

Permalink
fix: don't try to add to a null milliseconds counter
Browse files Browse the repository at this point in the history
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
  • Loading branch information
Octol1ttle committed Mar 28, 2024
1 parent 2c42f36 commit 8e7a274
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TimeComputer implements ITickableComputer {
*/
public float deltaTime;
public boolean highlight;
public Float millis = 0.0f;
public Float millis;
private Float prevMillis;
private float highlightMillis;

Expand All @@ -36,6 +36,9 @@ public void tick() {
if (mc.isInSingleplayer() && mc.isPaused()) {
return;
}
if (millis == null) {
millis = 0.0f;
}
millis += deltaMS;

if (millis - highlightMillis > HIGHLIGHT_SWITCH_THRESHOLD) {
Expand Down

0 comments on commit 8e7a274

Please sign in to comment.