Skip to content

Commit

Permalink
Fix sodium compat
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Jan 3, 2025
1 parent 0b692cd commit ebc5f4c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ dependencies {
modLocalImplementation "com.terraformersmc:modmenu:${mod_menu_version}"

// iris and sodium
// modImplementation("maven.modrinth:sodium:${project.sodium_version}")
// modImplementation("maven.modrinth:iris:${project.iris_version}")
// runtimeOnly("org.anarres:jcpp:${project.jcpp_version}")
// implementation("io.github.douira:glsl-transformer:${project.glslTransformer_version}")
modImplementation("maven.modrinth:sodium:${project.sodium_version}") { transitive = true }
modImplementation("maven.modrinth:iris:${project.iris_version}") { transitive = true }
}

processClientResources {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ mod_menu_version = 11.0.1
cca_version = 6.1.1
midnightlib_version = 1.5.7-fabric
satin_version = 2.0.0
sodium_version = mc1.21.1-0.6.2-fabric
sodium_version = mc1.21.1-0.6.5-fabric
iris_version = 1.8.1+1.21.1-fabric
jcpp_version = 1.4.14
glslTransformer_version = 2.0.0-pre13
veil_version = 1.0.0.82
veil_version = 1.0.0.83
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
//package org.ladysnake.effective.core.mixin.water.integration.sodium;
//
//@Mixin(FluidRenderer.class)
//public class SodiumWaterfallGeneratorAdder {
// @Inject(method = "render", at = @At("HEAD"))
// public void effective$generateWaterfall(LevelSlice world, BlockState blockState, FluidState fluidState, BlockPos pos, BlockPos offset, TranslucentGeometryCollector translucentGeometryCollector, ChunkBuildBuffers buffers, CallbackInfo ci) {
// WaterfallCloudGenerators.addGenerator(fluidState, pos.toImmutable());
// }
//}
package org.ladysnake.effective.core.mixin.water.integration.sodium;

import net.caffeinemc.mods.sodium.client.model.color.ColorProvider;
import net.caffeinemc.mods.sodium.client.render.chunk.compile.buffers.ChunkModelBuilder;
import net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.DefaultFluidRenderer;
import net.caffeinemc.mods.sodium.client.render.chunk.terrain.material.Material;
import net.caffeinemc.mods.sodium.client.render.chunk.translucent_sorting.TranslucentGeometryCollector;
import net.caffeinemc.mods.sodium.client.world.LevelSlice;
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import org.ladysnake.effective.core.world.WaterfallCloudGenerators;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(DefaultFluidRenderer.class)
public class SodiumWaterfallGeneratorAdder {
@Inject(method = "render", at = @At("HEAD"))
public void effective$generateWaterfall(LevelSlice level, BlockState blockState, FluidState fluidState, BlockPos blockPos, BlockPos offset, TranslucentGeometryCollector collector, ChunkModelBuilder meshBuilder, Material material, ColorProvider<FluidState> colorProvider, Sprite[] sprites, CallbackInfo ci) {
WaterfallCloudGenerators.addGenerator(fluidState, blockPos.toImmutable());
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/client/resources/effective_core.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"package": "org.ladysnake.effective.core.mixin",
"plugin": "org.ladysnake.effective.core.EffectiveMixinPlugin",
"compatibilityLevel": "JAVA_17",
"mixins": [],
"mixins": [
"water.integration.sodium.SodiumWaterfallGeneratorAdder"
],
"client": [
"BlockMixin",
"ClientWorldMixin",
Expand Down

0 comments on commit ebc5f4c

Please sign in to comment.