diff --git a/common/src/main/java/me/shedaniel/lightoverlay/common/LightOverlayTicker.java b/common/src/main/java/me/shedaniel/lightoverlay/common/LightOverlayTicker.java index a2539ec..7f8d160 100644 --- a/common/src/main/java/me/shedaniel/lightoverlay/common/LightOverlayTicker.java +++ b/common/src/main/java/me/shedaniel/lightoverlay/common/LightOverlayTicker.java @@ -5,12 +5,15 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import it.unimi.dsi.fastutil.longs.Long2ByteMap; import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Holder; +import net.minecraft.network.chat.CommonComponents; +import net.minecraft.network.chat.Component; import net.minecraft.tags.BlockTags; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; @@ -74,9 +77,11 @@ public void queueChunk(CubicChunkPos pos) { } public void tick(Minecraft minecraft) { - while (LightOverlay.enableOverlay.consumeClick()) + while (LightOverlay.enableOverlay.consumeClick()) { LightOverlay.enabled = !LightOverlay.enabled; - + minecraft.gui.setOverlayMessage(Component.translatable("overlay.lightoverlay").append(": ").append(LightOverlay.enabled ? Component.literal(CommonComponents.OPTION_ON.getString()).withStyle(ChatFormatting.GREEN) : Component.literal(CommonComponents.OPTION_OFF.getString()).withStyle(ChatFormatting.RED)), false); + } + try { ticks++; if (minecraft.player == null || !LightOverlay.enabled) { diff --git a/common/src/main/resources/assets/lightoverlay/lang/en_us.json b/common/src/main/resources/assets/lightoverlay/lang/en_us.json index d07f5a6..7c704e4 100755 --- a/common/src/main/resources/assets/lightoverlay/lang/en_us.json +++ b/common/src/main/resources/assets/lightoverlay/lang/en_us.json @@ -2,6 +2,7 @@ "key.lightoverlay.category": "Light Overlay", "key.lightoverlay.enable_overlay": "Toggle Light Overlay", "description.lightoverlay.caching": "Caching is recommended if the reach is above 16 or if you are running on a potato.", + "overlay.lightoverlay": "Light Overlay", "config.lightoverlay.general": "General", "config.lightoverlay.reach": "Reach:", "config.lightoverlay.caching": "Caching:",