OcelotRenderer .java

net.minecraft.client.renderer.entity.OcelotRenderer (class): members: CAT_OCELOT_BABY_LOCATION, CAT_OCELOT_LOCATION, getTextureLocation, createRenderState.

net.minecraft.client.renderer.entityclass36 linesclientextends AgeableMobRenderer<Ocelot1.6 KB

API Surface (3)

Identifier getTextureLocation(final FelineRenderState state)
FelineRenderState createRenderState()
void extractRenderState(final Ocelot entity, final FelineRenderState state, final float partialTicks)

Fields & Constants (2)

CAT_OCELOT_LOCATION
CAT_OCELOT_BABY_LOCATION

String literals (2)

"textures/entity/cat/ocelot.png"
"textures/entity/cat/ocelot_baby.png"

Full Source

OcelotRenderer.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.feline.AbstractFelineModel;
6
import net.minecraft.client.model.animal.feline.AdultOcelotModel;
7
import net.minecraft.client.model.animal.feline.BabyOcelotModel;
8
import net.minecraft.client.model.geom.ModelLayers;
9
import net.minecraft.client.renderer.entity.state.FelineRenderState;
10
import net.minecraft.resources.Identifier;
11
import net.minecraft.world.entity.animal.feline.Ocelot;
12
13
@Environment(EnvType.CLIENT)
14
public class OcelotRenderer extends AgeableMobRenderer<Ocelot, FelineRenderState, AbstractFelineModel<FelineRenderState>> {
15
	private static final Identifier CAT_OCELOT_LOCATION = Identifier.withDefaultNamespace("textures/entity/cat/ocelot.png");
16
	private static final Identifier CAT_OCELOT_BABY_LOCATION = Identifier.withDefaultNamespace("textures/entity/cat/ocelot_baby.png");
17
18
	public OcelotRenderer(final EntityRendererProvider.Context context) {
19
		super(context, new AdultOcelotModel(context.bakeLayer(ModelLayers.OCELOT)), new BabyOcelotModel(context.bakeLayer(ModelLayers.OCELOT_BABY)), 0.4F);
20
	}
21
22
	public Identifier getTextureLocation(final FelineRenderState state) {
23
		return state.isBaby ? CAT_OCELOT_BABY_LOCATION : CAT_OCELOT_LOCATION;
24
	}
25
26
	public FelineRenderState createRenderState() {
27
		return new FelineRenderState();
28
	}
29
30
	public void extractRenderState(final Ocelot entity, final FelineRenderState state, final float partialTicks) {
31
		super.extractRenderState(entity, state, partialTicks);
32
		state.isCrouching = entity.isCrouching();
33
		state.isSprinting = entity.isSprinting();
34
	}
35
}
36

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