diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-23 01:15:57 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-23 01:15:57 +0200 |
commit | 95d140ec1914eca1db840e3d87a94a02d664072f (patch) | |
tree | f40a282a48f855e7734008e98ab9ddcd8e07bc70 /src/main | |
parent | 91ee2303b807d6951088b377d8323bb486f716fa (diff) | |
download | skyhanni-95d140ec1914eca1db840e3d87a94a02d664072f.tar.gz skyhanni-95d140ec1914eca1db840e3d87a94a02d664072f.tar.bz2 skyhanni-95d140ec1914eca1db840e3d87a94a02d664072f.zip |
Added a title notification when Burrowing Spores drops
Diffstat (limited to 'src/main')
3 files changed, 27 insertions, 0 deletions
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 |