aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
index f12506c33..7f7a0cc91 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
@@ -9,10 +9,6 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
-import net.minecraft.client.Minecraft
-import net.minecraft.event.ClickEvent
-import net.minecraft.event.HoverEvent
-import net.minecraft.util.ChatComponentText
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -28,26 +24,18 @@ class JoinCrystalHollows {
if (message == "§cYou do not have an active Crystal Hollows pass!") {
lastWrongPassTime = System.currentTimeMillis()
if (LorenzUtils.skyBlockIsland != IslandType.DWARVEN_MINES) {
- sendClickableMessage("§e[SkyHanni] Click here to warp to Dwarven Mines!", "warp mines")
+ LorenzUtils.clickableChat("§e[SkyHanni] Click here to warp to Dwarven Mines!", "warp mines")
} else {
LorenzUtils.chat("§e[SkyHanni] Buy a §2Crystal Hollows Pass §efrom §5Gwendolyn")
}
}
if (message == "§e[NPC] §5Gwendolyn§f: §rGreat! Now hop on into the Minecart and I'll get you on your way!") {
if (inTime()) {
- sendClickableMessage("§e[SkyHanni] Click here to warp to Crystal Hollows!", "warp ch")
+ LorenzUtils.clickableChat("§e[SkyHanni] Click here to warp to Crystal Hollows!", "warp ch")
}
}
}
- private fun sendClickableMessage(message: String, command: String) {
- val text = ChatComponentText(message)
- text.chatStyle.chatClickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, "/$command")
- text.chatStyle.chatHoverEvent =
- HoverEvent(HoverEvent.Action.SHOW_TEXT, ChatComponentText("§eExecute /$command"))
- Minecraft.getMinecraft().thePlayer.addChatMessage(text)
- }
-
@SubscribeEvent
fun onIslandChange(event: IslandChangeEvent) {
if (!isEnabled()) return
@@ -77,5 +65,5 @@ class JoinCrystalHollows {
private fun inTime() = lastWrongPassTime + 1000 * 60 * 2 > System.currentTimeMillis()
- fun isEnabled() = SkyHanniMod.feature.misc.crystalHollowsJoin
+ fun isEnabled() = SkyHanniMod.feature.misc.crystalHollowsJoin
} \ No newline at end of file