Skip to content

Commit

Permalink
Add level of indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Apr 6, 2024
1 parent 40b75db commit 1ac66f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package moriyashiine.aylyth.client.integration.iris;

import net.irisshaders.iris.api.v0.IrisApi;

public class IrisCompat {
public static boolean isShaderPackInUse() {
return IrisApi.getInstance().isShaderPackInUse();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package moriyashiine.aylyth.client.render.block.entity;

import moriyashiine.aylyth.client.integration.iris.IrisCompat;
import moriyashiine.aylyth.client.render.AylythRenderLayers;
import moriyashiine.aylyth.common.block.entity.SeepBlockEntity;
import moriyashiine.aylyth.common.util.AylythUtil;
import net.fabricmc.loader.api.FabricLoader;
import net.irisshaders.iris.api.v0.IrisApi;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
Expand All @@ -19,7 +19,7 @@ public SeepBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {
public void render(SeepBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
MatrixStack.Entry matrix = matrices.peek();
VertexConsumer vertexConsumer;
if (!FabricLoader.getInstance().isModLoaded("iris") || !IrisApi.getInstance().isShaderPackInUse()) {
if (!FabricLoader.getInstance().isModLoaded("iris") || !IrisCompat.isShaderPackInUse()) {
vertexConsumer = vertexConsumers.getBuffer(AylythRenderLayers.SEEP);
this.renderSide(matrix.getPositionMatrix(), vertexConsumer, 0.0625F, 0.9375F, 0, 1, 0.9375F, 0.9375F);
this.renderSide(matrix.getPositionMatrix(), vertexConsumer, 0.0625F, 0.9375F, 1, 0, 0.0625F, 0.0625F);
Expand Down

0 comments on commit 1ac66f5

Please sign in to comment.