From 95d140ec1914eca1db840e3d87a94a02d664072f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 23 Apr 2023 01:15:57 +0200 Subject: Added a title notification when Burrowing Spores drops --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 1 + .../hannibal2/skyhanni/config/features/Garden.java | 6 ++++++ .../garden/farming/GardenBurrowingSporesNotifier.kt | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 50cb1fa0f..cb276b7ce 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -274,6 +274,7 @@ public class SkyHanniMod { loadModule(new GardenTeleportPadInventoryNumber()); loadModule(new ComposterOverlay()); loadModule(new GardenCropMilestoneFix()); + loadModule(new GardenBurrowingSporesNotifier()); Commands.INSTANCE.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index 07e97edaf..b6bb30838 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -970,6 +970,12 @@ public class Garden { @ConfigEditorBoolean public boolean fungiCutterWarn = true; + + @Expose + @ConfigOption(name = "Burrowing Spores", desc = "Show a notification when a Burrowing Spores spawns during farming mushrooms.") + @ConfigEditorBoolean + public boolean burrowingSporesNotification = true; + @Expose @ConfigOption(name = "Always Finnegan", desc = "Forcefully set the Finnegan Farming Simulator perk to be active. This is useful if the auto mayor detection fails.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt new file mode 100644 index 000000000..0d91abe60 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBurrowingSporesNotifier.kt @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.features.garden.farming + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.TitleUtils +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.garden.GardenAPI +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class GardenBurrowingSporesNotifier { + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!GardenAPI.inGarden()) return + if (!SkyHanniMod.feature.garden.burrowingSporesNotification) return + + if (event.message.endsWith("§6§lVERY RARE CROP! §r§f§r§9Burrowing Spores")) { + TitleUtils.sendTitle("§9Burrowing Spores!", 5_000) + } + } +} \ No newline at end of file -- cgit