package net.minecraft.client.renderer.entity; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.model.VexModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.layers.ItemInHandLayer; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.monster.Vex; @Environment(EnvType.CLIENT) public class VexRenderer extends MobRenderer { private static final ResourceLocation VEX_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/illager/vex.png"); private static final ResourceLocation VEX_CHARGING_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/illager/vex_charging.png"); public VexRenderer(EntityRendererProvider.Context context) { super(context, new VexModel(context.bakeLayer(ModelLayers.VEX)), 0.3F); this.addLayer(new ItemInHandLayer<>(this, context.getItemInHandRenderer())); } protected int getBlockLightLevel(Vex entity, BlockPos pos) { return 15; } /** * Returns the location of an entity's texture. */ public ResourceLocation getTextureLocation(Vex entity) { return entity.isCharging() ? VEX_CHARGING_LOCATION : VEX_LOCATION; } }