GlowSquidRenderer .java

net.minecraft.client.renderer.entity.GlowSquidRenderer (class): members: GLOW_SQUID_BABY_LOCATION, GLOW_SQUID_LOCATION, getBlockLightLevel. imports: Mth.

net.minecraft.client.renderer.entityclass31 linesclientextends SquidRenderer<GlowSquid>1.4 KB

API Surface (2)

Identifier getTextureLocation(final SquidRenderState state)
int getBlockLightLevel(final GlowSquid entity, final BlockPos blockPos)

Fields & Constants (2)

GLOW_SQUID_LOCATION
GLOW_SQUID_BABY_LOCATION

String literals (2)

"textures/entity/squid/glow_squid.png"
"textures/entity/squid/glow_squid_baby.png"

Full Source

GlowSquidRenderer.java31 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.squid.SquidModel;
6
import net.minecraft.client.renderer.entity.state.SquidRenderState;
7
import net.minecraft.core.BlockPos;
8
import net.minecraft.resources.Identifier;
9
import net.minecraft.util.Mth;
10
import net.minecraft.world.entity.animal.squid.GlowSquid;
11
12
@Environment(EnvType.CLIENT)
13
public class GlowSquidRenderer extends SquidRenderer<GlowSquid> {
14
	private static final Identifier GLOW_SQUID_LOCATION = Identifier.withDefaultNamespace("textures/entity/squid/glow_squid.png");
15
	private static final Identifier GLOW_SQUID_BABY_LOCATION = Identifier.withDefaultNamespace("textures/entity/squid/glow_squid_baby.png");
16
17
	public GlowSquidRenderer(final EntityRendererProvider.Context context, final SquidModel model, final SquidModel babyModel) {
18
		super(context, model, babyModel);
19
	}
20
21
	@Override
22
	public Identifier getTextureLocation(final SquidRenderState state) {
23
		return state.isBaby ? GLOW_SQUID_BABY_LOCATION : GLOW_SQUID_LOCATION;
24
	}
25
26
	protected int getBlockLightLevel(final GlowSquid entity, final BlockPos blockPos) {
27
		int glowLightLevel = (int)Mth.clampedLerp(1.0F - entity.getDarkTicksRemaining() / 10.0F, 0.0F, 15.0F);
28
		return glowLightLevel == 15 ? 15 : Math.max(glowLightLevel, super.getBlockLightLevel(entity, blockPos));
29
	}
30
}
31

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