38 lines
1.5 KiB
Java
38 lines
1.5 KiB
Java
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.WitchModel;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.MultiBufferSource;
|
|
import net.minecraft.client.renderer.entity.layers.WitchItemLayer;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.entity.monster.Witch;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class WitchRenderer extends MobRenderer<Witch, WitchModel<Witch>> {
|
|
private static final ResourceLocation WITCH_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/witch.png");
|
|
|
|
public WitchRenderer(EntityRendererProvider.Context context) {
|
|
super(context, new WitchModel<>(context.bakeLayer(ModelLayers.WITCH)), 0.5F);
|
|
this.addLayer(new WitchItemLayer<>(this, context.getItemInHandRenderer()));
|
|
}
|
|
|
|
public void render(Witch entity, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource buffer, int packedLight) {
|
|
this.model.setHoldingItem(!entity.getMainHandItem().isEmpty());
|
|
super.render(entity, entityYaw, partialTicks, poseStack, buffer, packedLight);
|
|
}
|
|
|
|
/**
|
|
* Returns the location of an entity's texture.
|
|
*/
|
|
public ResourceLocation getTextureLocation(Witch entity) {
|
|
return WITCH_LOCATION;
|
|
}
|
|
|
|
protected void scale(Witch livingEntity, PoseStack poseStack, float partialTickTime) {
|
|
float f = 0.9375F;
|
|
poseStack.scale(0.9375F, 0.9375F, 0.9375F);
|
|
}
|
|
}
|