Skip to content

Commit

Permalink
Updated TimeClicker.java with annotations
Browse files Browse the repository at this point in the history
very kind words :>
  • Loading branch information
SpvceR3ii authored Aug 20, 2024
1 parent 81c7323 commit e5b8696
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/spacereii/timeclicker/TimeClicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.DrawContext;
import net.minecraft.text.Text;

// fucking hell
public class TimeClicker implements ClientModInitializer {

private long startTime;
Expand All @@ -17,6 +18,7 @@ public void onInitializeClient() {
HudRenderCallback.EVENT.register(this::onHudRender);
}

// render the client and calculate the shi
private void onHudRender(DrawContext drawContext, float tickDelta) {
MinecraftClient client = MinecraftClient.getInstance();
long currentTime = System.currentTimeMillis();
Expand All @@ -25,7 +27,7 @@ private void onHudRender(DrawContext drawContext, float tickDelta) {
long minutes = (timePlayedMillis / (1000 * 60)) % 60;
long hours = (timePlayedMillis / (1000 * 60 * 60)) % 24;

String timePlayed = String.format("Time Played: %02d:%02d:%02d", hours, minutes, seconds);
drawContext.drawTextWithShadow(client.textRenderer, Text.of(timePlayed), 10, 10, 0xFFFFFF);
String timePlayed = String.format("Time Played: %02d:%02d:%02d", hours, minutes, seconds); // the actual thing
drawContext.drawTextWithShadow(client.textRenderer, Text.of(timePlayed), 10, 10, 0xFFFFFF); // config (?)
}
}

0 comments on commit e5b8696

Please sign in to comment.