package aeronicamc.mods.mxtune.gui;

import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.item.ItemStack;

public class ModGuiHelper
{
    public static void RenderGuiItemScaled(ItemRenderer itemRenderer, ItemStack pStack, int posX, int posY, int scale, boolean onCenter)
    {
        int xRel = (onCenter ? posX - 16*scale/2 : posX)/scale;
        int yRel = (onCenter ? posY - 16*scale/2 : posY)/scale;
        RenderSystem.scalef(scale, scale, 1F);
        itemRenderer.renderAndDecorateItem(pStack, xRel, yRel);
    }
}

@@ -338,16 +338,51 @@
 )%0A    %7B%0A
+        RenderSystem.pushMatrix();%0A
         
@@ -612,16 +612,50 @@
  yRel);%0A
+        RenderSystem.popMatrix();%0A
     %7D%0A%7D%0A

Save and restore the matrix so scaling only affects this item render.