diff options
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt | 17 |
1 files 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) } |