diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:28:37 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:28:37 +0200 |
commit | 024ba52fb69b6cd44b4e31542867f802de656f15 (patch) | |
tree | 86368585de8bf41f3f0f2bd9c8c66dae113190a4 /src/main/java/at/hannibal2/skyhanni/features/misc | |
parent | 26c9ff13df1a7e0a6508d11c98ff994cdc1d8902 (diff) | |
download | skyhanni-024ba52fb69b6cd44b4e31542867f802de656f15.tar.gz skyhanni-024ba52fb69b6cd44b4e31542867f802de656f15.tar.bz2 skyhanni-024ba52fb69b6cd44b4e31542867f802de656f15.zip |
Fixed that Paste Into Sign feature only pastes into the first line.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PasteIntoSigns.kt | 8 |
1 files changed, 5 insertions, 3 deletions
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 |