diff --git a/buildSrc/src/main/groovy/convention.shared.gradle b/buildSrc/src/main/groovy/convention.shared.gradle index 628c727..2b5fde6 100644 --- a/buildSrc/src/main/groovy/convention.shared.gradle +++ b/buildSrc/src/main/groovy/convention.shared.gradle @@ -37,6 +37,17 @@ repositories { name = "Ladysnake Mods" url = 'https://maven.ladysnake.org/releases' } + exclusiveContent { + forRepository { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + } + filter { + includeGroup "maven.modrinth" + } + } } configurations { diff --git a/common/src/main/java/dev/lukebemish/tempest/impl/Services.java b/common/src/main/java/dev/lukebemish/tempest/impl/Services.java index 0c4d4dd..04c2473 100644 --- a/common/src/main/java/dev/lukebemish/tempest/impl/Services.java +++ b/common/src/main/java/dev/lukebemish/tempest/impl/Services.java @@ -20,5 +20,7 @@ public static T load(Class clazz) { public interface Platform { WeatherChunkData getChunkData(LevelChunk chunk); Supplier register(Supplier supplier, ResourceLocation location, Registry registry); + + boolean modLoaded(String modId); } } diff --git a/common/src/main/java/dev/lukebemish/tempest/impl/data/world/WeatherChunkData.java b/common/src/main/java/dev/lukebemish/tempest/impl/data/world/WeatherChunkData.java index bef97c8..b4740ee 100644 --- a/common/src/main/java/dev/lukebemish/tempest/impl/data/world/WeatherChunkData.java +++ b/common/src/main/java/dev/lukebemish/tempest/impl/data/world/WeatherChunkData.java @@ -584,10 +584,10 @@ private void tryMeltBlock(ServerLevel level, BlockPos toMelt) { } else { level.setBlockAndUpdate(above, Blocks.AIR.defaultBlockState()); } - } else if (state.getBlock() == Blocks.SNOW_BLOCK || state.getBlock() == Blocks.POWDER_SNOW) { - level.setBlockAndUpdate(toMelt, Blocks.SNOW.defaultBlockState().setValue(SnowLayerBlock.LAYERS, 7)); } else if (stateAbove.getBlock() == Blocks.POWDER_SNOW) { level.setBlockAndUpdate(above, Blocks.SNOW.defaultBlockState().setValue(SnowLayerBlock.LAYERS, 7)); + } else if (state.getBlock() == Blocks.SNOW_BLOCK || state.getBlock() == Blocks.POWDER_SNOW) { + level.setBlockAndUpdate(toMelt, Blocks.SNOW.defaultBlockState().setValue(SnowLayerBlock.LAYERS, 7)); } } } diff --git a/fabriquilt/build.gradle b/fabriquilt/build.gradle index 78846c4..9462bf4 100644 --- a/fabriquilt/build.gradle +++ b/fabriquilt/build.gradle @@ -40,6 +40,10 @@ dependencies { } include libs.cca.base include libs.cca.chunk + + // Compat + + modLocalRuntime libs.snowrealmagic.fabric } // Publishing diff --git a/fabriquilt/src/main/java/dev/lukebemish/tempest/impl/fabriquilt/ModPlatform.java b/fabriquilt/src/main/java/dev/lukebemish/tempest/impl/fabriquilt/ModPlatform.java index 81cdf65..e0a378f 100644 --- a/fabriquilt/src/main/java/dev/lukebemish/tempest/impl/fabriquilt/ModPlatform.java +++ b/fabriquilt/src/main/java/dev/lukebemish/tempest/impl/fabriquilt/ModPlatform.java @@ -6,6 +6,7 @@ import dev.lukebemish.tempest.impl.data.WeatherMapData; import dev.lukebemish.tempest.impl.data.world.WeatherChunkData; import dev.lukebemish.tempest.impl.data.world.WeatherData; +import net.fabricmc.loader.api.FabricLoader; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; import net.minecraft.core.SectionPos; @@ -40,6 +41,11 @@ public Supplier register(Supplier supplier, ResourceLocat return () -> entry; } + @Override + public boolean modLoaded(String modId) { + return FabricLoader.getInstance().isModLoaded(modId); + } + private static final class EmptyData extends WeatherChunkData { public EmptyData(EmptyLevelChunk chunk) { super(chunk); diff --git a/forge/build.gradle b/forge/build.gradle index 002edef..30e495b 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -45,8 +45,12 @@ dependencies { implementation libs.mixinextras.forge include libs.mixinextras.forge + // Compat + modCompileOnly libs.embeddium - //modRuntimeOnly libs.embeddium + //modLocalRuntime libs.embeddium + + modLocalRuntime libs.snowrealmagic.forge } // Publishing diff --git a/forge/src/main/java/dev/lukebemish/tempest/impl/forge/ModPlatform.java b/forge/src/main/java/dev/lukebemish/tempest/impl/forge/ModPlatform.java index 4104be3..b16e5f7 100644 --- a/forge/src/main/java/dev/lukebemish/tempest/impl/forge/ModPlatform.java +++ b/forge/src/main/java/dev/lukebemish/tempest/impl/forge/ModPlatform.java @@ -13,6 +13,7 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.CapabilityToken; +import net.minecraftforge.fml.ModList; import net.minecraftforge.registries.DeferredRegister; import java.util.HashMap; @@ -44,4 +45,9 @@ public Supplier register(Supplier supplier, ResourceLocat DeferredRegister register = (DeferredRegister) REGISTRIES.computeIfAbsent(Pair.of(location.getNamespace(), registry.key()), k -> DeferredRegister.create(registry.key(), location.getNamespace())); return register.register(location.getPath(), supplier); } + + @Override + public boolean modLoaded(String modId) { + return ModList.get().isLoaded(modId); + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e01c488..7b1f5fe 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,8 @@ cca = "5.2.2" # Compat embeddium = "0.2.12-git.170afb8+mc1.20.1" +snowrealmagic_forge = "S9gp2AyE" +snowrealmagic_fabric = "eNt5cULd" [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } @@ -42,11 +44,14 @@ autoservice = { module = "com.google.auto.service:auto-service", version.ref = " mixinextras_common = { module = "io.github.llamalad7:mixinextras-common", version.ref = "mixinextras" } mixinextras_forge = { module = "io.github.llamalad7:mixinextras-forge", version.ref = "mixinextras" } -embeddium = { module = "org.embeddedt:embeddium-1.20.1", version.ref = "embeddium" } - cca-base = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-base", version.ref = "cca" } cca-chunk = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-chunk", version.ref = "cca" } +# Compat +embeddium = { module = "org.embeddedt:embeddium-1.20.1", version.ref = "embeddium" } +snowrealmagic_forge = { module = "maven.modrinth:snow-real-magic", version.ref = "snowrealmagic_forge" } +snowrealmagic_fabric = { module = "maven.modrinth:snow-real-magic", version.ref = "snowrealmagic_fabric" } + [plugins] managedversioning = { id = "dev.lukebemish.managedversioning", version.ref = "managedversioning" }