aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 13:47:39 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 13:47:39 +0100
commit09e1f680f34ec1ad1df16afdaceb7cce58442ade (patch)
treebf2fb25104839d3b07887d2d968a61cc57b6176f /src/main/java
parent4dba63532ad6723e99c95f00bd0cd8a774a33752 (diff)
downloadskyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.tar.gz
skyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.tar.bz2
skyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.zip
Automatic unlocking /shmouselock when teleporting in the garden.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt)8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt6
3 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index c63003f1e..8dd3640b6 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -133,12 +133,12 @@ import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishMessages
import at.hannibal2.skyhanni.features.garden.AnitaMedalProfit
import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay
import at.hannibal2.skyhanni.features.garden.GardenAPI
-import at.hannibal2.skyhanni.features.garden.GardenCommands
import at.hannibal2.skyhanni.features.garden.GardenCropMilestoneFix
import at.hannibal2.skyhanni.features.garden.GardenLevelDisplay
import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest
import at.hannibal2.skyhanni.features.garden.GardenOptimalSpeed
import at.hannibal2.skyhanni.features.garden.GardenPlotBorders
+import at.hannibal2.skyhanni.features.garden.GardenWarpCommands
import at.hannibal2.skyhanni.features.garden.GardenYawAndPitch
import at.hannibal2.skyhanni.features.garden.ToolTooltipTweaks
import at.hannibal2.skyhanni.features.garden.composter.ComposterDisplay
@@ -385,7 +385,7 @@ class SkyHanniMod {
loadModule(ActionBarStatsData)
loadModule(GardenCropMilestoneInventory())
loadModule(GardenCropSpeed)
- loadModule(GardenCommands())
+ loadModule(GardenWarpCommands())
loadModule(ProfileStorageData)
loadModule(TitleData())
loadModule(BlockData())
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt
index 3ae6b81f6..81b5fb2a3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt
@@ -2,13 +2,14 @@ package at.hannibal2.skyhanni.features.garden
import at.hannibal2.skyhanni.events.LorenzKeyPressEvent
import at.hannibal2.skyhanni.events.MessageSendToServerEvent
+import at.hannibal2.skyhanni.features.misc.LockMouseLook
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import net.minecraft.client.Minecraft
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-class GardenCommands {
+class GardenWarpCommands {
private val config get() = GardenAPI.config.gardenCommands
// TODO repo
@@ -30,12 +31,14 @@ class GardenCommands {
if (message == "/barn") {
event.isCanceled = true
LorenzUtils.sendCommandToServer("tptoplot barn")
+ LockMouseLook.autoDisable()
}
tpPlotPattern.matchMatcher(message) {
event.isCanceled = true
val plotName = group("plot")
LorenzUtils.sendCommandToServer("tptoplot $plotName")
+ LockMouseLook.autoDisable()
}
}
@@ -52,6 +55,9 @@ class GardenCommands {
else -> return
}
+ if (command != "warp garden") {
+ LockMouseLook.autoDisable()
+ }
LorenzUtils.sendCommandToServer(command)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
index 14b430d19..4025c32e2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -46,4 +46,10 @@ object LockMouseLook {
if (!lockedMouse) return
config.lockedMouseDisplay.renderString("§eMouse Locked", posLabel = "Mouse Locked")
}
+
+ fun autoDisable() {
+ if (lockedMouse) {
+ toggleLock()
+ }
+ }
}