mirror of
https://github.com/wisplite/crystalline-sky.git
synced 2026-10-30 13:32:18 -05:00
Skybox V
iris doesn't explode, at least
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.function.Supplier;
|
||||
|
||||
public enum Mods {
|
||||
SODIUM("sodium"),
|
||||
IRIS("iris"),
|
||||
AXIOM("axiom");
|
||||
|
||||
public final String id;
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package io.github.slimeistdev.crystalline_sky.mixin.client.compat.iris;
|
||||
|
||||
import io.github.slimeistdev.crystalline_sky.annotation.mixin.ConditionalMixin;
|
||||
import io.github.slimeistdev.crystalline_sky.compat.Mods;
|
||||
import io.github.slimeistdev.crystalline_sky.mixin.client.compat.sodium.TerrainRenderPassAccessor;
|
||||
import io.github.slimeistdev.crystalline_sky.registry.client.CrystallineRenderTypes;
|
||||
import net.caffeinemc.mods.sodium.client.render.chunk.terrain.TerrainRenderPass;
|
||||
import net.irisshaders.iris.pipeline.programs.SodiumPrograms;
|
||||
import net.irisshaders.iris.shadows.ShadowRenderingState;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@ConditionalMixin(mods = Mods.IRIS)
|
||||
@Mixin(SodiumPrograms.class)
|
||||
public class SodiumProgramsMixin {
|
||||
@Inject(method = "mapTerrainRenderPass", at = @At(value = "NEW", target = "(Ljava/lang/String;)Ljava/lang/IllegalArgumentException;"), cancellable = true)
|
||||
private static void customRenderTypes(TerrainRenderPass pass, CallbackInfoReturnable<SodiumPrograms.Pass> cir) {
|
||||
RenderType renderType = ((TerrainRenderPassAccessor) pass).crystalline_sky$getRenderLayer();
|
||||
if (renderType == CrystallineRenderTypes.SKY || renderType == CrystallineRenderTypes.SKYBOX) {
|
||||
cir.setReturnValue(ShadowRenderingState.areShadowsCurrentlyBeingRendered() ? SodiumPrograms.Pass.SHADOW : SodiumPrograms.Pass.TERRAIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package io.github.slimeistdev.crystalline_sky.mixin.client.compat.iris;
|
||||
|
||||
import io.github.slimeistdev.crystalline_sky.annotation.mixin.ConditionalMixin;
|
||||
import io.github.slimeistdev.crystalline_sky.compat.Mods;
|
||||
import io.github.slimeistdev.crystalline_sky.registry.client.CrystallineRenderTypes;
|
||||
import net.irisshaders.iris.pipeline.WorldRenderingPhase;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@ConditionalMixin(mods = Mods.IRIS)
|
||||
@Mixin(WorldRenderingPhase.class)
|
||||
public class WorldRenderingPhaseMixin {
|
||||
@Inject(method = "fromTerrainRenderType", at = @At(value = "NEW", target = "(Ljava/lang/String;)Ljava/lang/IllegalStateException;"), cancellable = true)
|
||||
private static void customRenderTypes(RenderType renderType, CallbackInfoReturnable<WorldRenderingPhase> cir) {
|
||||
if (renderType == CrystallineRenderTypes.SKY || renderType == CrystallineRenderTypes.SKYBOX)
|
||||
cir.setReturnValue(WorldRenderingPhase.TERRAIN_SOLID);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,8 @@
|
||||
"client.ModelBlockRendererMixin",
|
||||
"client.RenderTargetMixin",
|
||||
"client.SimpleBakedModelMixin",
|
||||
"client.compat.iris.SodiumProgramsMixin",
|
||||
"client.compat.iris.WorldRenderingPhaseMixin",
|
||||
"client.compat.sodium.CompactChunkVertexMixin",
|
||||
"client.compat.sodium.DefaultMaterialsMixin",
|
||||
"client.compat.sodium.DefaultTerrainRenderPassesMixin",
|
||||
|
||||
Reference in New Issue
Block a user