Skip to content

Commit

Permalink
add correct pipeline phase on block destroy animation
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrycat2004 authored and mitchej123 committed Oct 26, 2024
1 parent f233ba6 commit 72c13cf
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.IResourceManagerReloadListener;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.EntityLivingBase;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -98,4 +100,10 @@ public abstract class MixinEntityRenderer implements IResourceManagerReloadListe
pipeline.get().setPhase(WorldRenderingPhase.NONE);
}

@WrapOperation(method = "renderWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V"))
private void iris$blockDamageTexture(RenderGlobal instance, Tessellator tessellator, EntityLivingBase entity, float partialTicks, Operation<Void> original, @Share("pipeline") LocalRef<WorldRenderingPipeline> pipeline) {
pipeline.get().setPhase(WorldRenderingPhase.DESTROY);
original.call(instance, tessellator, entity, partialTicks);
pipeline.get().setPhase(WorldRenderingPhase.NONE);
}
}

0 comments on commit 72c13cf

Please sign in to comment.