diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt | 20 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/MovementSpeedDisplay.kt | 11 |
2 files changed, 18 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt index 437d69883..018867116 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConditionalUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -13,9 +12,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.renderables.Renderable -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import io.github.moulberry.moulconfig.observer.Property import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiEditSign @@ -33,7 +30,21 @@ class GardenOptimalSpeed { private var sneakingTime = 0.seconds private val sneaking get() = Minecraft.getMinecraft().thePlayer.isSneaking private val sneakingPersistent get() = sneakingTime > 5.seconds + + /** + * This speed value represents the walking speed, not the speed stat. + * blocks per second = 4.317 * speed / 100 + * + * It has an absolute speed cap of 500, and items that normally increase the cap do not apply here: + * (Black Cat pet, Cactus knife, Racing Helmet or Young Dragon Armor) + * + * If this information ever gets abstracted away and made available outside this class, + * and some features need the actual value of the Speed stat instead, + * we can always just have two separate variables, like walkSpeed and speedStat. + * But since this change is confined to Garden-specific code, it's fine the way it is for now. + */ private var currentSpeed = 100 + private var optimalSpeed = -1 private var lastWarnTime = 0L private var cropInHand: CropType? = null @@ -130,7 +141,8 @@ class GardenOptimalSpeed { val recentlySwitchedTool = lastToolSwitch.passedSince() < 1.5.seconds val recentlyStartedSneaking = sneaking && !sneakingPersistent - val colorCode = if (recentlySwitchedTool || recentlyStartedSneaking) "7" else if (optimalSpeed != currentSpeed) "c" else "a" + val colorCode = + if (recentlySwitchedTool || recentlyStartedSneaking) "7" else if (optimalSpeed != currentSpeed) "c" else "a" if (config.showOnHUD) config.pos.renderString("ยง$colorCode$text", posLabel = "Garden Optimal Speed") if (optimalSpeed != currentSpeed && !recentlySwitchedTool && !recentlyStartedSneaking) warn() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MovementSpeedDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MovementSpeedDisplay.kt index 7f412a0c6..7e145ba34 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MovementSpeedDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MovementSpeedDisplay.kt @@ -23,15 +23,8 @@ class MovementSpeedDisplay { companion object { /** - * This speed value represents the walking speed, not the speed stat. - * - * It has an absolute speed cap of 500, and items that normally increase the cap do not apply here: - * (Black Cat pet, Cactus knife, Racing Helmet or Young Dragon Armor) - * - * If this information ever gets abstracted away and made available outside this class, - * and some features need the actual value of the Speed stat instead, - * we can always just have two separate variables, like walkSpeed and speedStat. - * But since this change is confined to Garden-specific code, it's fine the way it is for now. + * This speed value represents the movement speed in blocks per second. + * This has nothing to do with the speed stat. */ var speed = 0.0 var usingSoulsandSpeed = false |