From 68c9844d02e7ceb13b8dcf6f090cef5a8ce6f037 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 29 Aug 2023 21:19:09 +0200 Subject: code cleanup --- .../features/misc/massconfiguration/DefaultConfigFeatures.kt | 2 +- src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt index a1f40c6e9..ef9bd1e75 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt @@ -9,7 +9,7 @@ import net.minecraft.command.CommandBase import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object DefaultConfigFeatures { - var didNotifyOnce = false + private var didNotifyOnce = false @SubscribeEvent fun onTick(event: LorenzTickEvent) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 248efd5df..4e01f5da6 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -234,9 +234,10 @@ object LorenzUtils { fun clickableChat(message: String, command: String) { val text = ChatComponentText(message) - text.chatStyle.chatClickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, "/${command.removePrefix("/")}") + val fullCommand = "/" + command.removePrefix("/") + text.chatStyle.chatClickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, fullCommand) text.chatStyle.chatHoverEvent = - HoverEvent(HoverEvent.Action.SHOW_TEXT, ChatComponentText("§eExecute /${command.removePrefix("/")}")) + HoverEvent(HoverEvent.Action.SHOW_TEXT, ChatComponentText("§eExecute $fullCommand")) Minecraft.getMinecraft().thePlayer.addChatMessage(text) } -- cgit