GoatRenderer .java

net.minecraft.client.renderer.entity.GoatRenderer (class, 36 lines): members: BABY_GOAT_LOCATION, GOAT_LOCATION, getTextureLocation, createRenderState.

net.minecraft.client.renderer.entityclass36 linesclientextends AgeableMobRenderer<Goat1.5 KB

API Surface (3)

Identifier getTextureLocation(final GoatRenderState state)
GoatRenderState createRenderState()
void extractRenderState(final Goat entity, final GoatRenderState state, final float partialTicks)

Fields & Constants (2)

GOAT_LOCATION
BABY_GOAT_LOCATION

String literals (2)

"textures/entity/goat/goat.png"
"textures/entity/goat/goat_baby.png"

Full Source

GoatRenderer.java36 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.animal.goat.BabyGoatModel;
6
import net.minecraft.client.model.animal.goat.GoatModel;
7
import net.minecraft.client.model.geom.ModelLayers;
8
import net.minecraft.client.renderer.entity.state.GoatRenderState;
9
import net.minecraft.resources.Identifier;
10
import net.minecraft.world.entity.animal.goat.Goat;
11
12
@Environment(EnvType.CLIENT)
13
public class GoatRenderer extends AgeableMobRenderer<Goat, GoatRenderState, GoatModel> {
14
	private static final Identifier GOAT_LOCATION = Identifier.withDefaultNamespace("textures/entity/goat/goat.png");
15
	private static final Identifier BABY_GOAT_LOCATION = Identifier.withDefaultNamespace("textures/entity/goat/goat_baby.png");
16
17
	public GoatRenderer(final EntityRendererProvider.Context context) {
18
		super(context, new GoatModel(context.bakeLayer(ModelLayers.GOAT)), new BabyGoatModel(context.bakeLayer(ModelLayers.GOAT_BABY)), 0.7F);
19
	}
20
21
	public Identifier getTextureLocation(final GoatRenderState state) {
22
		return state.isBaby ? BABY_GOAT_LOCATION : GOAT_LOCATION;
23
	}
24
25
	public GoatRenderState createRenderState() {
26
		return new GoatRenderState();
27
	}
28
29
	public void extractRenderState(final Goat entity, final GoatRenderState state, final float partialTicks) {
30
		super.extractRenderState(entity, state, partialTicks);
31
		state.hasLeftHorn = entity.hasLeftHorn();
32
		state.hasRightHorn = entity.hasRightHorn();
33
		state.rammingXHeadRot = entity.getRammingXHeadRot();
34
	}
35
}
36

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