Goggles are on your eyes if you wear something on your head.

This commit is contained in:
patryk3211 2022-05-11 14:42:43 +02:00
parent 5af222a99b
commit 2ed5ee9f3b

View File

@ -18,6 +18,7 @@ import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.entity.RenderLayerParent; import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@ -53,6 +54,11 @@ public class GogglesCurioRenderer implements ICurioRenderer {
matrixStack.mulPose(Vector3f.ZP.rotationDegrees(180.0f)); matrixStack.mulPose(Vector3f.ZP.rotationDegrees(180.0f));
matrixStack.scale(0.625f, 0.625f, 0.625f); matrixStack.scale(0.625f, 0.625f, 0.625f);
if(!slotContext.entity().getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
matrixStack.mulPose(Vector3f.ZP.rotationDegrees(180.0f));
matrixStack.translate(0, -0.25, 0);
}
// Render // Render
Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemTransforms.TransformType.HEAD, light, OverlayTexture.NO_OVERLAY, matrixStack, renderTypeBuffer, 0); Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemTransforms.TransformType.HEAD, light, OverlayTexture.NO_OVERLAY, matrixStack, renderTypeBuffer, 0);
matrixStack.popPose(); matrixStack.popPose();