GlowSquidRenderer.java
net.minecraft.client.renderer.entity.GlowSquidRenderer
信息
- 全限定名:net.minecraft.client.renderer.entity.GlowSquidRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.entity
- 源码路径:src/main/java/net/minecraft/client/renderer/entity/GlowSquidRenderer.java
- 起始行号:L13
- 继承:SquidRenderer
- 职责:
TODO
字段/常量
-
GLOW_SQUID_LOCATION- 类型:
Identifier - 修饰符:
private static final - 源码定位:
L14 - 说明:
TODO
- 类型:
-
GLOW_SQUID_BABY_LOCATION- 类型:
Identifier - 修饰符:
private static final - 源码定位:
L15 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public GlowSquidRenderer(EntityRendererProvider.Context context, SquidModel model, SquidModel babyModel) @ L17
- 构造器名:GlowSquidRenderer
- 源码定位:L17
- 修饰符:public
参数:
- context: EntityRendererProvider.Context
- model: SquidModel
- babyModel: SquidModel
说明:
TODO
方法
下面的方法块按源码顺序生成。
public Identifier getTextureLocation(SquidRenderState state) @ L21
- 方法名:getTextureLocation
- 源码定位:L21
- 返回类型:Identifier
- 修饰符:public
参数:
- state: SquidRenderState
说明:
TODO
protected int getBlockLightLevel(GlowSquid entity, BlockPos blockPos) @ L26
- 方法名:getBlockLightLevel
- 源码定位:L26
- 返回类型:int
- 修饰符:protected
参数:
- entity: GlowSquid
- blockPos: BlockPos
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class GlowSquidRenderer extends SquidRenderer<GlowSquid> {
private static final Identifier GLOW_SQUID_LOCATION = Identifier.withDefaultNamespace("textures/entity/squid/glow_squid.png");
private static final Identifier GLOW_SQUID_BABY_LOCATION = Identifier.withDefaultNamespace("textures/entity/squid/glow_squid_baby.png");
public GlowSquidRenderer(EntityRendererProvider.Context context, SquidModel model, SquidModel babyModel) {
super(context, model, babyModel);
}
@Override
public Identifier getTextureLocation(SquidRenderState state) {
return state.isBaby ? GLOW_SQUID_BABY_LOCATION : GLOW_SQUID_LOCATION;
}
protected int getBlockLightLevel(GlowSquid entity, BlockPos blockPos) {
int glowLightLevel = (int)Mth.clampedLerp(1.0F - entity.getDarkTicksRemaining() / 10.0F, 0.0F, 15.0F);
return glowLightLevel == 15 ? 15 : Math.max(glowLightLevel, super.getBlockLightLevel(entity, blockPos));
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
字段/方法调用/返回值 - 关联成员:
Identifier.withDefaultNamespace()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Mth.clampedLerp()
- 引用位置:
-
- 引用位置:
参数
- 引用位置: