From 6908fa9e28ad57b6b748d7f726ef47d3b358f381 Mon Sep 17 00:00:00 2001 From: desyncfy Date: Sat, 8 Jun 2024 14:16:08 -0700 Subject: [PATCH] Start work on Auto-Welcome module. NOTE: 20% does NOT mean 20% of the features work. It means I estimate I am 20% done with this module. --- README.md | 2 +- .../kotlin/chickenmanfy/scify/Modules/autowelcome.kt | 12 +++++++++++- src/client/kotlin/chickenmanfy/scify/SciFyClient.kt | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c9947f1..3cf7a56 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,6 @@ _Currently in super beta so don't expect something working for a while._ - Health & Food bars replaced with dynamic bar similar to EXP bar (0%) - Custom GUIs (0%) - Built-in guide (CANCELED) **This feature is being worked on in a different mod called "Mythicfy", so it will not be added to this one. We recommend you download that mod.** -- Auto-Welcome (0%) **WARNING: This feature may prove to be annoying, in which case we will remove it.** +- Auto-Welcome (20%) **WARNING: This feature may prove to be annoying, in which case we will remove it.** - City NPCs (Lively Mode) (0%) - Fishing notifications (0%) \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt b/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt index 8722786..7dd8433 100644 --- a/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt +++ b/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt @@ -1,4 +1,14 @@ package chickenmanfy.scify.Modules -class autowelcome { +import net.minecraft.client.MinecraftClient +import net.minecraft.text.Text + +fun autowelcome() { + val minecraftClient = MinecraftClient.getInstance() + val message: Text = Text.literal("Hi!") + if (minecraftClient?.player != null) { + minecraftClient.player!!.sendMessage(message, false) + } else { + println("MinecraftClient or player is null!") + } } \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt index 3ffef26..0fabd88 100644 --- a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt +++ b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt @@ -8,11 +8,11 @@ import net.minecraft.client.option.KeyBinding import net.minecraft.client.util.InputUtil import net.minecraft.text.Text import org.lwjgl.glfw.GLFW +import chickenmanfy.scify.Modules.autowelcome object SciFyClient : ClientModInitializer { override fun onInitializeClient() { - val menu = KeyBindingHelper.registerKeyBinding( KeyBinding( "Menu", @@ -28,5 +28,6 @@ object SciFyClient : ClientModInitializer { } }) + autowelcome() } }