Skip to content

Commit

Permalink
Fixed glowing grave feature not working properly with iris
Browse files Browse the repository at this point in the history
  • Loading branch information
B1n-ry committed Nov 6, 2023
1 parent d4a2054 commit 6a95d7f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.b1n_ry.yigd.block.entity.GraveBlockEntity;
import com.b1n_ry.yigd.config.YigdConfig;
import com.b1n_ry.yigd.events.RenderGlowingGraveEvent;
import com.b1n_ry.yigd.mixin.accessor.WorldRendererAccessor;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
Expand All @@ -14,6 +15,7 @@
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.model.*;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.OutlineVertexConsumerProvider;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
Expand Down Expand Up @@ -83,8 +85,11 @@ public void render(GraveBlockEntity entity, float tickDelta, MatrixStack matrice

matrices.multiply(RotationAxis.POSITIVE_Y.rotation(rotation), .5f, .5f, .5f);

if (config.useGlowingEffect && !entity.isClaimed())
this.renderGlowingOutline(entity, tickDelta, matrices, vertexConsumers, light, overlay);
if (config.useGlowingEffect && !entity.isClaimed()) {
// Get the actual outline vertex consumer, instead of the normal one
OutlineVertexConsumerProvider consumerProvider = ((WorldRendererAccessor) this.client.worldRenderer).getBufferBuilders().getOutlineVertexConsumers();
this.renderGlowingOutline(entity, tickDelta, matrices, consumerProvider, light, overlay);
}

if (config.useSkullRenderer)
this.renderOwnerSkull(entity, tickDelta, matrices, vertexConsumers, light, overlay);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.b1n_ry.yigd.mixin.accessor;

import net.minecraft.client.render.BufferBuilderStorage;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(WorldRenderer.class)
public interface WorldRendererAccessor {
@Accessor("bufferBuilders")
BufferBuilderStorage getBufferBuilders();
}
3 changes: 2 additions & 1 deletion src/main/resources/yigd.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
],
"client": [
"AbstractConfigScreenMixin",
"WorldRendererMixin"
"WorldRendererMixin",
"accessor.WorldRendererAccessor"
],
"server": [
"MinecraftDedicatedServerMixin"
Expand Down

0 comments on commit 6a95d7f

Please sign in to comment.