aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-05-03 02:46:57 +1000
committerGitHub <noreply@github.com>2024-05-02 18:46:57 +0200
commit1906566a63afd876e2761cd14b929ecb11fb06ed (patch)
treeaa56af28c1cec8211b61d783f6af594ee587a99b
parentfbbf7034a7bf3577d2f0ba9d783892e600a46c59 (diff)
downloadNotEnoughUpdates-1906566a63afd876e2761cd14b929ecb11fb06ed.tar.gz
NotEnoughUpdates-1906566a63afd876e2761cd14b929ecb11fb06ed.tar.bz2
NotEnoughUpdates-1906566a63afd876e2761cd14b929ecb11fb06ed.zip
meta: Fix auto update showing in dev env (#1120)
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.kt17
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)
}