Advertisement
GeradesoLukas

Untitled

Sep 27th, 2022
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. @OnlyIn(Dist.CLIENT)
  2. @Mixin(ItemRenderer.class)
  3. public class MixinItemRenderer {
  4.     @WrapOperation(
  5.             method = "Lnet/minecraft/client/renderer/entity/ItemRenderer;renderGuiItem(Lnet/minecraft/world/item/ItemStack;IILnet/minecraft/client/resources/model/BakedModel;)V",
  6.             at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderColor(FFFF)V"))
  7.     private void injectRenderer(RenderSystem instance, float pRed, float pGreen, float pBlue, float pAlpha, Operation<Void> original, ItemStack pStack, int pX, int pY, BakedModel pBakedModel) {
  8.         if (ItemUtils.isBroken(pStack)) {
  9.             original.call(instance, 0.0f, pGreen, pBlue, pAlpha);
  10.         }
  11.         else original.call(instance, pRed, pGreen, pBlue, pAlpha);
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement