aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/raeids
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/raeids')
-rw-r--r--src/main/kotlin/com/raeids/stratus/Stratus.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/kotlin/com/raeids/stratus/Stratus.kt b/src/main/kotlin/com/raeids/stratus/Stratus.kt
index 653c265..ba2e739 100644
--- a/src/main/kotlin/com/raeids/stratus/Stratus.kt
+++ b/src/main/kotlin/com/raeids/stratus/Stratus.kt
@@ -3,6 +3,7 @@ package com.raeids.stratus
import com.raeids.stratus.command.StratusCommand
import com.raeids.stratus.config.StratusConfig
import com.raeids.stratus.hook.ChatTabs
+import com.raeids.stratus.hook.GuiNewChatHook
import com.raeids.stratus.mixin.GuiNewChatAccessor
import com.raeids.stratus.updater.Updater
import com.raeids.stratus.utils.RenderHelper
@@ -14,6 +15,7 @@ import net.minecraft.client.gui.GuiChat
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.settings.KeyBinding
import net.minecraft.client.shader.Framebuffer
+import net.minecraftforge.client.event.MouseEvent
import net.minecraftforge.common.MinecraftForge.EVENT_BUS
import net.minecraftforge.fml.client.registry.ClientRegistry
import net.minecraftforge.fml.common.Mod
@@ -22,6 +24,8 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
import org.lwjgl.input.Keyboard
+import java.awt.Toolkit
+import java.awt.datatransfer.StringSelection
import java.io.File
import java.io.IOException
import java.text.SimpleDateFormat
@@ -65,6 +69,18 @@ object Stratus {
}
@SubscribeEvent
+ fun onMouseClick(event: MouseEvent) {
+ val hook = Minecraft.getMinecraft().ingameGUI.chatGUI as GuiNewChatHook
+ if (hook.shouldCopy()) {
+ try {
+ Toolkit.getDefaultToolkit().systemClipboard.setContents(StringSelection(hook.copyString()), null)
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
+ }
+
+ @SubscribeEvent
fun onTickEvent(event: TickEvent.ClientTickEvent) {
if (event.phase == TickEvent.Phase.START && Minecraft.getMinecraft().theWorld != null && Minecraft.getMinecraft().thePlayer != null && (Minecraft.getMinecraft().currentScreen == null || Minecraft.getMinecraft().currentScreen is GuiChat)) {
if (doTheThing) {