From 1906566a63afd876e2761cd14b929ecb11fb06ed Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 3 May 2024 02:46:57 +1000 Subject: meta: Fix auto update showing in dev env (#1120) --- .../miscfeatures/updater/AutoUpdater.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt index a522cb47..fbce87e6 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt @@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.util.brigadier.thenExecute import moe.nea.libautoupdate.* import net.minecraft.client.Minecraft import net.minecraft.event.ClickEvent +import net.minecraft.launchwrapper.Launch import net.minecraft.util.ChatComponentText import net.minecraftforge.common.MinecraftForge import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -106,14 +107,16 @@ object AutoUpdater { return@thenAcceptAsync } updateState = UpdateState.AVAILABLE - Minecraft.getMinecraft().thePlayer?.addChatMessage(ChatComponentText("§e[NEU] §aNEU found a new update: ${it.update.versionName}. Click here to automatically install this update.").apply { - this.chatStyle = this.chatStyle.setChatClickEvent( - ClickEvent( - ClickEvent.Action.RUN_COMMAND, - "/neuinternalupdatenow" + if (Launch.blackboard["fml.deobfuscatedEnvironment"] != true) { + Minecraft.getMinecraft().thePlayer?.addChatMessage(ChatComponentText("§e[NEU] §aNEU found a new update: ${it.update.versionName}. Click here to automatically install this update.").apply { + this.chatStyle = this.chatStyle.setChatClickEvent( + ClickEvent( + ClickEvent.Action.RUN_COMMAND, + "/neuinternalupdatenow" + ) ) - ) - }) + }) + } } }, MinecraftExecutor.OnThread) } -- cgit