From 024ba52fb69b6cd44b4e31542867f802de656f15 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 16 Sep 2023 12:28:37 +0200 Subject: Fixed that Paste Into Sign feature only pastes into the first line. --- .../java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt index bdddcc3a7..98a16eb4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt @@ -6,21 +6,23 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils import kotlinx.coroutines.launch import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import org.lwjgl.input.Keyboard class PasteIntoSigns { + private var lastClicked = false @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.onHypixel) return if (!SkyHanniMod.feature.misc.pasteIntoSigns) return - if (LorenzUtils.isControlKeyDown() && OSUtils.isKeyHeld(Keyboard.KEY_V)) { + val currentlyClicked = LorenzUtils.isPastingKeysDown() + if (!lastClicked && currentlyClicked) { SkyHanniMod.coroutineScope.launch { OSUtils.readFromClipboard()?.let { - LorenzUtils.setTextIntoSign(it.take(15)) + LorenzUtils.addTextIntoSign(it.take(15)) } } } + lastClicked = currentlyClicked } } \ No newline at end of file -- cgit