diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt index 8ea793bc13f7..929b3616a8a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt @@ -1,9 +1,12 @@ 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 @@ -18,4 +21,10 @@ object LavaReplacement { Minecraft.getMinecraft().renderGlobal.loadRenderers() } } + + fun replaceLava(): Boolean { + if (!LorenzUtils.inSkyBlock || !config.enabled.get()) return false + if (config.onlyInCrimsonIsle.get() && !IslandType.CRIMSON_ISLE.isInIsland()) return false + return true + } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockFluidRendererHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockFluidRendererHook.kt deleted file mode 100644 index 14b7bd597d69..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/BlockFluidRendererHook.kt +++ /dev/null @@ -1,17 +0,0 @@ -package at.hannibal2.skyhanni.mixins.hooks - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.IslandType -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland - -object BlockFluidRendererHook { - private val config get() = SkyHanniMod.feature.fishing.lavaReplacement - - @JvmStatic - fun replaceLava(): Boolean { - if (!LorenzUtils.inSkyBlock || !config.enabled.get()) return false - if (config.onlyInCrimsonIsle.get() && !IslandType.CRIMSON_ISLE.isInIsland()) return false - return true - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockLiquid.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockLiquid.java index 44492b44fd7f..645bcf9f4f50 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockLiquid.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinBlockLiquid.java @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.mixins.transformers; -import at.hannibal2.skyhanni.mixins.hooks.BlockFluidRendererHook; +import at.hannibal2.skyhanni.features.fishing.LavaReplacement; import net.minecraft.client.renderer.BlockFluidRenderer; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import org.spongepowered.asm.mixin.Mixin; @@ -18,8 +18,8 @@ public abstract class MixinBlockLiquid { method = "renderFluid", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockLiquid;colorMultiplier(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/BlockPos;)I") ) - TextureAtlasSprite[] replacerenderedFluid(TextureAtlasSprite[] value) { - if (BlockFluidRendererHook.replaceLava()) { + TextureAtlasSprite[] replaceRenderedFluid(TextureAtlasSprite[] value) { + if (LavaReplacement.INSTANCE.replaceLava()) { return this.atlasSpritesWater; } return value;