From 141b21bea55ae696a9bb25a89ed8f6012e67b213 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Thu, 4 Jan 2024 09:36:18 +1100 Subject: [PATCH] Avoid referencing SeasonHooks inside the TemperatureHelper mixin for Forge --- .../main/java/toughasnails/forge/init/ModCompatibility.java | 6 ++++++ .../forge/mixin/MixinTemperatureHelperImpl.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java b/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java index 54687bf0..49fbb1a8 100644 --- a/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java +++ b/forge/src/main/java/toughasnails/forge/init/ModCompatibility.java @@ -12,6 +12,7 @@ import sereneseasons.api.season.Season; import sereneseasons.api.season.SeasonHelper; import sereneseasons.init.ModTags; +import sereneseasons.season.SeasonHooks; import toughasnails.api.temperature.TemperatureHelper; import toughasnails.api.temperature.TemperatureLevel; import toughasnails.core.ToughAsNails; @@ -28,6 +29,11 @@ public static void init() } } + public static boolean coldEnoughToSnowSeasonal(Level level, Holder biome, BlockPos pos) + { + return SeasonHooks.coldEnoughToSnowSeasonal(level, biome, pos); + } + private static TemperatureLevel seasonModifier(Level level, BlockPos pos, TemperatureLevel current) { Holder biome = level.getBiome(pos); diff --git a/forge/src/main/java/toughasnails/forge/mixin/MixinTemperatureHelperImpl.java b/forge/src/main/java/toughasnails/forge/mixin/MixinTemperatureHelperImpl.java index 5697a78b..8fba531a 100644 --- a/forge/src/main/java/toughasnails/forge/mixin/MixinTemperatureHelperImpl.java +++ b/forge/src/main/java/toughasnails/forge/mixin/MixinTemperatureHelperImpl.java @@ -11,7 +11,7 @@ import net.minecraftforge.fml.ModList; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import sereneseasons.season.SeasonHooks; +import toughasnails.forge.init.ModCompatibility; import toughasnails.temperature.TemperatureHelperImpl; @Mixin(value = TemperatureHelperImpl.class, remap = false) @@ -22,7 +22,7 @@ private static boolean coldEnoughToSnow(Level level, Holder biome, BlockP { if (ModList.get().isLoaded("sereneseasons")) { - return SeasonHooks.coldEnoughToSnowSeasonal(level, biome, pos); + return ModCompatibility.coldEnoughToSnowSeasonal(level, biome, pos); } else {