diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index ff987b524..fba471eb4 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -72,6 +72,8 @@ dependencies { modImplementation("net.fabricmc:fabric-loader:${property("fabric_loader_version")}") modApi("net.fabricmc.fabric-api:fabric-api:${property("fabric_api_version")}") + modCompileOnly(":sodium-fabric-1.20.1-0.6.0-intermediary-mappings") + modCompileOnly("maven.modrinth:sodium:${property("sodium_version")}") modCompileOnly("maven.modrinth:iris:${property("iris_version")}") diff --git a/fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java b/fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java index 64e4b31e2..13eaa3a6c 100644 --- a/fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java +++ b/fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java @@ -2,7 +2,9 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import dev.engine_room.flywheel.lib.visualization.VisualizationHelper; import me.jellysquid.mods.sodium.client.render.chunk.compile.tasks.ChunkBuilderMeshingTask; @@ -12,11 +14,18 @@ @Mixin(value = ChunkBuilderMeshingTask.class, remap = false) abstract class ChunkBuilderMeshingTaskMixin { - @Redirect(method = "execute", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;getRenderer(Lnet/minecraft/world/level/block/entity/BlockEntity;)Lnet/minecraft/client/renderer/blockentity/BlockEntityRenderer;", remap = true)) - private BlockEntityRenderer flywheel$redirectGetRenderer(BlockEntityRenderDispatcher dispatcher, BlockEntity blockEntity) { + @WrapOperation( + method = "execute(Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildContext;Lme/jellysquid/mods/sodium/client/util/task/CancellationToken;)Lme/jellysquid/mods/sodium/client/render/chunk/compile/ChunkBuildOutput;", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/renderer/blockentity/BlockEntityRenderDispatcher;getRenderer(Lnet/minecraft/world/level/block/entity/BlockEntity;)Lnet/minecraft/client/renderer/blockentity/BlockEntityRenderer;", + remap = true + ) + ) + private BlockEntityRenderer flywheel$wrapGetRenderer(BlockEntityRenderDispatcher instance, BlockEntity blockEntity, Operation> original) { if (VisualizationHelper.tryAddBlockEntity(blockEntity)) { return null; } - return dispatcher.getRenderer(blockEntity); + return original.call(instance, blockEntity); } } diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index b5b43e6cd..74772153b 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -83,6 +83,8 @@ loom { dependencies { forge("net.minecraftforge:forge:${property("minecraft_version")}-${property("forge_version")}") + modCompileOnly(":sodium-fabric-1.20.1-0.6.0-intermediary-mappings") + modCompileOnly("maven.modrinth:embeddium:${property("embeddium_version")}") modCompileOnly("maven.modrinth:oculus:${property("oculus_version")}")