Skip to content

Commit

Permalink
Fix weird duplications with TntMinecartRenderer mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbot16 committed Sep 14, 2021
1 parent 409b793 commit 9dfcb86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package net.coderbot.iris.mixin;

import com.mojang.blaze3d.vertex.PoseStack;
import net.coderbot.batchedentityrendering.impl.Groupable;
import net.coderbot.iris.layer.EntityColorRenderStateShard;
import net.coderbot.iris.layer.InnerWrappedRenderType;
import net.coderbot.iris.layer.EntityColorMultiBufferSource;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.TntMinecartRenderer;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -14,9 +15,14 @@
public abstract class MixinTntMinecartRenderer {
@ModifyVariable(method = "renderWhiteSolidBlock", at = @At("HEAD"))
private static MultiBufferSource iris$wrapProvider(MultiBufferSource provider, BlockState blockState, PoseStack matrices, MultiBufferSource bufferSource, int light, boolean drawFlash) {
if (!(provider instanceof Groupable)) {
// Entity color is not supported in this context, no buffering available.
return provider;
}

if (drawFlash) {
EntityColorRenderStateShard phase = new EntityColorRenderStateShard(false, 1.0F);
return type -> provider.getBuffer(new InnerWrappedRenderType("iris_entity_color", type, phase));
return new EntityColorMultiBufferSource(provider, phase);
} else {
return provider;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mixins.iris.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"MixinTextureAtlas",
"MixinTheEndPortalRenderer",
"MixinTitleScreen",
"MixinTntMinecartEntityRenderer",
"MixinTntMinecartRenderer",
"MixinTweakFarPlane",
"entity_render_context.MixinBlockEntityRenderDispatcher",
"entity_render_context.MixinEntityRenderDispatcher",
Expand Down

0 comments on commit 9dfcb86

Please sign in to comment.