Skip to content

Commit

Permalink
fix Mojang shit
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiZapic committed Jul 8, 2022
1 parent fa72d27 commit 0ec1d12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/moe/zapic/clockhud/render/DayCountRender.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package moe.zapic.clockhud.render;

import com.mojang.blaze3d.systems.RenderSystem;
import moe.zapic.clockhud.Main;
import moe.zapic.clockhud.Utils;
import net.minecraft.client.MinecraftClient;
Expand All @@ -14,7 +13,7 @@ public class DayCountRender {
public static float renderTime = 0.0f;
public static long currentDay = -1;
public static float Duration = 100.0f;
public static int TextOpacity = 5;
public static int TextOpacity = 4;

public static void render(MatrixStack matrices, float tickDelta, CallbackInfo ci) {
if(!Main.config.showDayCount) return;
Expand All @@ -37,9 +36,10 @@ public static void render(MatrixStack matrices, float tickDelta, CallbackInfo ci

public static void setRenderStatus() {
if(renderTime <= 20) {
TextOpacity = Math.max((int) (0xff * (renderTime / 20)), 5);
// Mojang shit, will treat all opacity < 0x04 as 0xff
TextOpacity = (int) (0xfb * (renderTime / 20)) + 4;
} else if (renderTime >= 80) {
TextOpacity = (int) (0xff * (1 - renderTime / 20));
TextOpacity = (int) (0xfb * (1 - renderTime / 20)) + 4;
} else if (TextOpacity != 0xff) {
TextOpacity = 0xff;
}
Expand Down

0 comments on commit 0ec1d12

Please sign in to comment.