minecraft-src/net/minecraft/client/renderer/entity/GhastRenderer.java
2025-07-04 01:41:11 +03:00

33 lines
1.2 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.GhastModel;
import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.monster.Ghast;
@Environment(EnvType.CLIENT)
public class GhastRenderer extends MobRenderer<Ghast, GhastModel<Ghast>> {
private static final ResourceLocation GHAST_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/ghast/ghast.png");
private static final ResourceLocation GHAST_SHOOTING_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/ghast/ghast_shooting.png");
public GhastRenderer(EntityRendererProvider.Context context) {
super(context, new GhastModel<>(context.bakeLayer(ModelLayers.GHAST)), 1.5F);
}
/**
* Returns the location of an entity's texture.
*/
public ResourceLocation getTextureLocation(Ghast entity) {
return entity.isCharging() ? GHAST_SHOOTING_LOCATION : GHAST_LOCATION;
}
protected void scale(Ghast livingEntity, PoseStack poseStack, float partialTickTime) {
float f = 1.0F;
float g = 4.5F;
float h = 4.5F;
poseStack.scale(4.5F, 4.5F, 4.5F);
}
}