From 4f696dca502d52d77a941c0504006878d2133d1f Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:03:30 +0100 Subject: Feature: Custom fishing hook alert text (#1169) --- .../config/features/fishing/FishingHookDisplayConfig.java | 12 +++++++++++- .../skyhanni/features/fishing/FishingHookDisplay.kt | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/FishingHookDisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/FishingHookDisplayConfig.java index e2cfdfa05..b0357eb0c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/FishingHookDisplayConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/FishingHookDisplayConfig.java @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.config.core.config.Position; import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigEditorText; import io.github.moulberry.moulconfig.annotations.ConfigOption; public class FishingHookDisplayConfig { @@ -14,6 +15,15 @@ public class FishingHookDisplayConfig { @FeatureToggle public boolean enabled = true; + @Expose + @ConfigOption( + name = "Custom Alert", + desc = "Replaces the default §c§l!!!§r Hypixel\n" + + "§7alert with your own custom one." + ) + @ConfigEditorText + public String customAlertText = "&c&l!!!"; + @Expose @ConfigOption( name = "Hide Armor Stand", @@ -23,5 +33,5 @@ public class FishingHookDisplayConfig { public boolean hideArmorStand = true; @Expose - public Position position = new Position(460, -240, 3.4f); + public Position position = new Position(-475, -240, 3.4f, true); } 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 671ae0841..32e31edf0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt @@ -75,8 +75,9 @@ class FishingHookDisplay { return } if (!armorStand.hasCustomName()) return + val alertText = if (armorStand.name == "§c§l!!!") config.customAlertText.replace("&", "§") else armorStand.name - config.position.renderString(armorStand.name, posLabel = "Fishing Hook Display") + config.position.renderString(alertText, posLabel = "Fishing Hook Display") } private fun EntityArmorStand.hasCorrectName(): Boolean { -- cgit