GhastRenderer .java

net.minecraft.client.renderer.entity.GhastRenderer (class, 33 lines): members: GHAST_SHOOTING_LOCATION, GHAST_LOCATION, getTextureLocation. imports: Ghast.

net.minecraft.client.renderer.entityclass33 linesclientextends MobRenderer<Ghast1.3 KB

API Surface (3)

Identifier getTextureLocation(final GhastRenderState state)
GhastRenderState createRenderState()
void extractRenderState(final Ghast entity, final GhastRenderState state, final float partialTicks)

Fields & Constants (2)

GHAST_LOCATION
GHAST_SHOOTING_LOCATION

String literals (2)

"textures/entity/ghast/ghast.png"
"textures/entity/ghast/ghast_shooting.png"

Full Source

GhastRenderer.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer.entity;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.client.model.geom.ModelLayers;
6
import net.minecraft.client.model.monster.ghast.GhastModel;
7
import net.minecraft.client.renderer.entity.state.GhastRenderState;
8
import net.minecraft.resources.Identifier;
9
import net.minecraft.world.entity.monster.Ghast;
10
11
@Environment(EnvType.CLIENT)
12
public class GhastRenderer extends MobRenderer<Ghast, GhastRenderState, GhastModel> {
13
	private static final Identifier GHAST_LOCATION = Identifier.withDefaultNamespace("textures/entity/ghast/ghast.png");
14
	private static final Identifier GHAST_SHOOTING_LOCATION = Identifier.withDefaultNamespace("textures/entity/ghast/ghast_shooting.png");
15
16
	public GhastRenderer(final EntityRendererProvider.Context context) {
17
		super(context, new GhastModel(context.bakeLayer(ModelLayers.GHAST)), 1.5F);
18
	}
19
20
	public Identifier getTextureLocation(final GhastRenderState state) {
21
		return state.isCharging ? GHAST_SHOOTING_LOCATION : GHAST_LOCATION;
22
	}
23
24
	public GhastRenderState createRenderState() {
25
		return new GhastRenderState();
26
	}
27
28
	public void extractRenderState(final Ghast entity, final GhastRenderState state, final float partialTicks) {
29
		super.extractRenderState(entity, state, partialTicks);
30
		state.isCharging = entity.isCharging();
31
	}
32
}
33

Decompiled Minecraft 26.3 source of GhastRenderer (net/minecraft/client/renderer/entity/GhastRenderer.java) with Mojang official mappings, stored verbatim on the site.