From 0671e35163d55ab0f940aa6806a0d7bfb2876429 Mon Sep 17 00:00:00 2001 From: HiZe Date: Fri, 11 Oct 2024 18:33:04 +0200 Subject: Feature: Change lava color (#1885) Co-authored-by: nea Co-authored-by: Cal Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> --- .../skyhanni/features/fishing/LavaReplacement.kt | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt new file mode 100644 index 000000000..663f2d87a --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt @@ -0,0 +1,31 @@ +package at.hannibal2.skyhanni.features.fishing + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.ConfigLoadEvent +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.ConditionalUtils +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import net.minecraft.client.Minecraft +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@SkyHanniModule +object LavaReplacement { + + private val config get() = SkyHanniMod.feature.fishing.lavaReplacement + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + ConditionalUtils.onToggle(config.enabled, config.onlyInCrimsonIsle) { + Minecraft.getMinecraft().renderGlobal.loadRenderers() + } + } + + @JvmStatic + fun replaceLava(): Boolean { + if (!LorenzUtils.inSkyBlock || !config.enabled.get()) return false + if (config.onlyInCrimsonIsle.get() && !IslandType.CRIMSON_ISLE.isInIsland()) return false + return true + } +} -- cgit