blob: 98a16eb4c1ce4ea42e4e8d795834072929c98a00 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.OSUtils
import kotlinx.coroutines.launch
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PasteIntoSigns {
private var lastClicked = false
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!LorenzUtils.onHypixel) return
if (!SkyHanniMod.feature.misc.pasteIntoSigns) return
val currentlyClicked = LorenzUtils.isPastingKeysDown()
if (!lastClicked && currentlyClicked) {
SkyHanniMod.coroutineScope.launch {
OSUtils.readFromClipboard()?.let {
LorenzUtils.addTextIntoSign(it.take(15))
}
}
}
lastClicked = currentlyClicked
}
}
|