MainHand.java
net.minecraft.client.renderer.item.properties.select.MainHand
信息
- 全限定名:net.minecraft.client.renderer.item.properties.select.MainHand
- 类型:public record
- 包:net.minecraft.client.renderer.item.properties.select
- 源码路径:src/main/java/net/minecraft/client/renderer/item/properties/select/MainHand.java
- 起始行号:L15
- 实现:SelectItemModelProperty
- 职责:
TODO
字段/常量
-
VALUE_CODEC- 类型:
Codec<HumanoidArm> - 修饰符:
public static final - 源码定位:
L16 - 说明:
TODO
- 类型:
-
TYPE- 类型:
SelectItemModelProperty.Type<MainHand,HumanoidArm> - 修饰符:
public static final - 源码定位:
L17 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public HumanoidArm get(ItemStack itemStack, ClientLevel level, LivingEntity owner, int seed, ItemDisplayContext displayContext) @ L21
- 方法名:get
- 源码定位:L21
- 返回类型:HumanoidArm
- 修饰符:public
参数:
- itemStack: ItemStack
- level: ClientLevel
- owner: LivingEntity
- seed: int
- displayContext: ItemDisplayContext
说明:
TODO
public SelectItemModelProperty.Type<MainHand,HumanoidArm> type() @ L27
- 方法名:type
- 源码定位:L27
- 返回类型:SelectItemModelProperty.Type<MainHand,HumanoidArm>
- 修饰符:public
参数:
- 无
说明:
TODO
public Codec<HumanoidArm> valueCodec() @ L32
- 方法名:valueCodec
- 源码定位:L32
- 返回类型:Codec
- 修饰符:public
参数:
- 无
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public record MainHand() implements SelectItemModelProperty<HumanoidArm> {
public static final Codec<HumanoidArm> VALUE_CODEC = HumanoidArm.CODEC;
public static final SelectItemModelProperty.Type<MainHand, HumanoidArm> TYPE = SelectItemModelProperty.Type.create(
MapCodec.unit(new MainHand()), VALUE_CODEC
);
public @Nullable HumanoidArm get(
ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner, int seed, ItemDisplayContext displayContext
) {
return owner == null ? null : owner.getMainArm();
}
@Override
public SelectItemModelProperty.Type<MainHand, HumanoidArm> type() {
return TYPE;
}
@Override
public Codec<HumanoidArm> valueCodec() {
return VALUE_CODEC;
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
字段/实现/方法调用/返回值 - 关联成员:
SelectItemModelProperty.Type.create()
- 引用位置:
-
- 引用位置:
字段/返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置: