diff options
author | IlmarsXd <ilmars500@gmail.com> | 2023-02-08 16:21:44 +0200 |
---|---|---|
committer | IlmarsXd <ilmars500@gmail.com> | 2023-02-08 16:21:44 +0200 |
commit | 926f7f42da7853975eb75b33bdfc4ce5f5c2ea44 (patch) | |
tree | 4445f4e6659887f45884b5f284d6a70e05309fa7 /src/main/kotlin/dulkirmod/DulkirMod.kt | |
parent | 154f612ed8d866755a227b42d5485d3ac08e1d7c (diff) | |
download | DulkirMod-926f7f42da7853975eb75b33bdfc4ce5f5c2ea44.tar.gz DulkirMod-926f7f42da7853975eb75b33bdfc4ce5f5c2ea44.tar.bz2 DulkirMod-926f7f42da7853975eb75b33bdfc4ce5f5c2ea44.zip |
use TextUtils for messages, cleanup code
Diffstat (limited to 'src/main/kotlin/dulkirmod/DulkirMod.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/DulkirMod.kt | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index ab11e9e..51df365 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -6,6 +6,7 @@ import dulkirmod.events.ChatEvent import dulkirmod.features.* import dulkirmod.features.chat.AbiphoneDND import dulkirmod.utils.ContainerNameUtil +import dulkirmod.utils.TextUtils import dulkirmod.utils.TitleUtils import dulkirmod.utils.Utils.getArea import kotlinx.coroutines.CoroutineScope @@ -14,7 +15,6 @@ import kotlinx.coroutines.launch import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.client.settings.KeyBinding -import net.minecraft.util.ChatComponentText import net.minecraftforge.client.ClientCommandHandler import net.minecraftforge.common.MinecraftForge import net.minecraftforge.fml.client.registry.ClientRegistry @@ -93,19 +93,13 @@ class DulkirMod { display = null } - var longupdate = false - val currTime: Long = System.currentTimeMillis() - if (currTime - lastLongUpdate > 1000) { - longupdate = true - lastLongUpdate = currTime - } - if (longupdate) { - // EXECUTE STUFF HERE THAT DOESN'T REALLY NEED TO BE RUN EVERY TICK + val currTime = System.currentTimeMillis() + if (currTime - lastLongUpdate > 1000) { // long update alarmClock() brokenHypeNotif() matchoAlert.alert() getArea() - longupdate = false + lastLongUpdate = currTime } } @@ -114,7 +108,7 @@ class DulkirMod { if (keyBinds[0].isPressed) display = config.gui() if (keyBinds[1].isPressed) { Config.noReverse3rdPerson = !Config.noReverse3rdPerson - mc.thePlayer.addChatMessage(ChatComponentText("§7Toggling No Selfie Camera Setting... now: §6${Config.noReverse3rdPerson}")) + TextUtils.toggledMessage("No Selfie Camera", Config.noReverse3rdPerson) } } @@ -122,7 +116,7 @@ class DulkirMod { const val MOD_ID = "dulkirmod" const val MOD_NAME = "Dulkir Mod" const val MOD_VERSION = "1.1.5" - const val CHAT_PREFIX = "§f<§3DulkirMod§f>" + const val CHAT_PREFIX = "§f<§3DulkirMod§f>§r" val mc: Minecraft = Minecraft.getMinecraft() var config = Config |