Skip to content

Commit

Permalink
Fix floating powdered snow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Jan 7, 2024
1 parent 5f0ff86 commit bd751cd
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 5 deletions.
11 changes: 11 additions & 0 deletions buildSrc/src/main/groovy/convention.shared.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ public static <T> T load(Class<T> clazz) {
public interface Platform {
WeatherChunkData getChunkData(LevelChunk chunk);
<S, T extends S> Supplier<T> register(Supplier<T> supplier, ResourceLocation location, Registry<S> registry);

boolean modLoaded(String modId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions fabriquilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ dependencies {
}
include libs.cca.base
include libs.cca.chunk

// Compat

modLocalRuntime libs.snowrealmagic.fabric
}

// Publishing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -40,6 +41,11 @@ public <S, T extends S> Supplier<T> register(Supplier<T> 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);
Expand Down
6 changes: 5 additions & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -44,4 +45,9 @@ public <S, T extends S> Supplier<T> register(Supplier<T> supplier, ResourceLocat
DeferredRegister<S> register = (DeferredRegister<S>) 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);
}
}
9 changes: 7 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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" }
Expand Down

0 comments on commit bd751cd

Please sign in to comment.