package net.minecraft.client.renderer.entity; import com.mojang.blaze3d.vertex.PoseStack; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.VillagerModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.layers.CrossedArmsItemLayer; import net.minecraft.client.renderer.entity.layers.CustomHeadLayer; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.npc.WanderingTrader; @Environment(EnvType.CLIENT) public class WanderingTraderRenderer extends MobRenderer> { private static final ResourceLocation VILLAGER_BASE_SKIN = ResourceLocation.withDefaultNamespace("textures/entity/wandering_trader.png"); public WanderingTraderRenderer(EntityRendererProvider.Context context) { super(context, new VillagerModel<>(context.bakeLayer(ModelLayers.WANDERING_TRADER)), 0.5F); this.addLayer(new CustomHeadLayer<>(this, context.getModelSet(), context.getItemInHandRenderer())); this.addLayer(new CrossedArmsItemLayer<>(this, context.getItemInHandRenderer())); } /** * Returns the location of an entity's texture. */ public ResourceLocation getTextureLocation(WanderingTrader entity) { return VILLAGER_BASE_SKIN; } protected void scale(WanderingTrader livingEntity, PoseStack poseStack, float partialTickTime) { float f = 0.9375F; poseStack.scale(0.9375F, 0.9375F, 0.9375F); } }