diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 4 | ||||
-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.kt | 6 |
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() + } + } } |