38 lines
1.3 KiB
Java
38 lines
1.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer.entity;
|
|
|
|
import net.minecraft.client.model.SquidModel;
|
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
|
import net.minecraft.client.renderer.entity.SquidRenderer;
|
|
import net.minecraft.client.renderer.entity.state.SquidRenderState;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.util.Mth;
|
|
import net.minecraft.world.entity.GlowSquid;
|
|
|
|
public class GlowSquidRenderer
|
|
extends SquidRenderer<GlowSquid> {
|
|
private static final Identifier GLOW_SQUID_LOCATION = Identifier.withDefaultNamespace("textures/entity/squid/glow_squid.png");
|
|
|
|
public GlowSquidRenderer(EntityRendererProvider.Context context, SquidModel model, SquidModel babyModel) {
|
|
super(context, model, babyModel);
|
|
}
|
|
|
|
@Override
|
|
public Identifier getTextureLocation(SquidRenderState state) {
|
|
return GLOW_SQUID_LOCATION;
|
|
}
|
|
|
|
@Override
|
|
protected int getBlockLightLevel(GlowSquid entity, BlockPos blockPos) {
|
|
int glowLightLevel = (int)Mth.clampedLerp(1.0f - (float)entity.getDarkTicksRemaining() / 10.0f, 0.0f, 15.0f);
|
|
if (glowLightLevel == 15) {
|
|
return 15;
|
|
}
|
|
return Math.max(glowLightLevel, super.getBlockLightLevel(entity, blockPos));
|
|
}
|
|
}
|
|
|