From f3d5d4dcb6f9101afc69950a5d45af5dd3da10c9 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 8 Oct 2023 09:51:15 +0200 Subject: Added debug options for fishing hook display. --- .../skyhanni/config/features/FishingConfig.java | 32 +++++++++++++++++++++- .../features/fishing/FishingHookDisplay.kt | 4 +-- 2 files changed, 33 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java index 444021146..a2c187fbb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/FishingConfig.java @@ -226,12 +226,42 @@ public class FishingConfig { public boolean enabled = true; @Expose - @ConfigOption(name = "Hide Armor Stand", desc = "Hide the original armor stand from Hypixel when the SkyHanni display is enabled.") + @ConfigOption( + name = "Hide Armor Stand", + desc = "Hide the original armor stand from Hypixel when the SkyHanni display is enabled." + ) @ConfigEditorBoolean public boolean hideArmorStand = true; @Expose public Position position = new Position(460, -240, 3.4f); + + @Expose + @ConfigOption( + name = "Debug: Update Interval", + desc = "Changes the time in ticks between updates (should be as high as possible). Default is 20" + ) + @ConfigEditorSlider( + minValue = 1, + maxValue = 80, + minStep = 1 + ) + @ConfigAccordionId(id = 2) + public int debugUpdateInterval = 20; + + @Expose + @ConfigOption( + name = "Debug: Distance", + desc = "Changes the maximal detection distance between the fishing rod bobber and " + + "the armor stand that shows the hypixel timer (should be as low as possible). Default is 0.1" + ) + @ConfigEditorSlider( + minValue = 0.01f, + maxValue = 5f, + minStep = 0.01f + ) + @ConfigAccordionId(id = 2) + public double debugMaxDistance = 0.1; } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt index 1ecfa75c7..cf9b6141c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt @@ -33,7 +33,7 @@ class FishingHookDisplay { @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - if (!event.repeatSeconds(1)) return + if (!event.isMod(config.debugUpdateInterval)) return val entities = EntityUtils.getEntities() bobberLocation = entities.firstOrNull { it.angler is EntityPlayerSP }?.getLorenzVec() @@ -47,7 +47,7 @@ class FishingHookDisplay { val bobberLocation = bobberLocation ?: return val distance = entity.getLorenzVec().distance(bobberLocation) - if (distance > 0.1) return + if (distance > config.debugMaxDistance) return if (entity is EntityArmorStand) { armorStand = entity } -- cgit