aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-11-12 16:45:51 -0800
committerAppability <appable@icloud.com>2022-11-12 16:45:51 -0800
commit21a3f8f1ed7230655cfe2f1e93b8edb14a2a21d0 (patch)
treed4c6376e4dbb17efb36120728401646949faf16d /src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt
parentde601769d8a1b5fc7543d5b0b4a95596db926416 (diff)
downloadAmbientAddons-21a3f8f1ed7230655cfe2f1e93b8edb14a2a21d0.tar.gz
AmbientAddons-21a3f8f1ed7230655cfe2f1e93b8edb14a2a21d0.tar.bz2
AmbientAddons-21a3f8f1ed7230655cfe2f1e93b8edb14a2a21d0.zip
add welcome message
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt b/src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt
new file mode 100644
index 0000000..ac99025
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/features/misc/Welcome.kt
@@ -0,0 +1,33 @@
+package com.ambientaddons.features.misc
+
+import AmbientAddons.Companion.mc
+import AmbientAddons.Companion.persistentData
+import com.ambientaddons.utils.SBLocation
+import gg.essential.universal.UChat
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent
+
+object Welcome {
+
+ @SubscribeEvent
+ fun onTick(event: ClientTickEvent) {
+ if (!persistentData.isFirstLoad || event.phase != TickEvent.Phase.START || !SBLocation.inSkyblock) return
+ val chatWidth = mc.ingameGUI?.chatGUI?.chatWidth ?: return
+ persistentData.isFirstLoad = false
+ persistentData.save()
+ val chatBreak = "§9§m" + "-".repeat(chatWidth / mc.fontRendererObj.getStringWidth("-"))
+ UChat.chat("""
+ $chatBreak
+ §b§lThanks for installing AmbientAddons Forge!
+
+ §eUse §a§l/ambient §r§eto access GUI settings.
+ §eAliases: §a/aa §eor §a/ambientaddons
+
+ §eTo configure auto-buy, use §a/ambient buy§e.
+ §eTo configure salvage features, use §a/ambient salvage§e.
+ $chatBreak
+ """.trimIndent())
+ }
+} \ No newline at end of file