MultiblockChestResources.java
net.minecraft.client.renderer.MultiblockChestResources
信息
- 全限定名:net.minecraft.client.renderer.MultiblockChestResources
- 类型:public record
- 包:net.minecraft.client.renderer
- 源码路径:src/main/java/net/minecraft/client/renderer/MultiblockChestResources.java
- 起始行号:L9
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public T select(ChestType chestType) @ L10
- 方法名:select
- 源码定位:L10
- 返回类型:T
- 修饰符:public
参数:
- chestType: ChestType
说明:
TODO
public <S> MultiblockChestResources<S> map(Function<T,S> mapper) @ L18
- 方法名:map
- 源码定位:L18
- 返回类型:
MultiblockChestResources - 修饰符:public
参数:
- mapper: Function<T,S>
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public record MultiblockChestResources<T>(T single, T left, T right) {
public T select(ChestType chestType) {
return (T)(switch (chestType) {
case SINGLE -> this.single;
case LEFT -> this.left;
case RIGHT -> this.right;
});
}
public <S> MultiblockChestResources<S> map(Function<T, S> mapper) {
return new MultiblockChestResources<>(mapper.apply(this.single), mapper.apply(this.left), mapper.apply(this.right));
}
}引用的其他类
- ChestType
- 引用位置:
参数
- 引用位置: