WallAndGroundTransformations.java

net.minecraft.client.renderer.blockentity.WallAndGroundTransformations

信息

  • 全限定名:net.minecraft.client.renderer.blockentity.WallAndGroundTransformations
  • 类型:public class
  • 包:net.minecraft.client.renderer.blockentity
  • 源码路径:src/main/java/net/minecraft/client/renderer/blockentity/WallAndGroundTransformations.java
  • 起始行号:L12
  • 职责:

    TODO

字段/常量

  • wallTransforms

    • 类型: Map<Direction,T>
    • 修饰符: private final
    • 源码定位: L13
    • 说明:

      TODO

  • freeTransformations

    • 类型: T[]
    • 修饰符: private final
    • 源码定位: L14
    • 说明:

      TODO

内部类/嵌套类型

构造器

public WallAndGroundTransformations(Function<Direction,T> wallTransformationFactory, IntFunction<T> freeTransformationFactory, int segments) @ L16

  • 构造器名:WallAndGroundTransformations
  • 源码定位:L16
  • 修饰符:public

参数:

  • wallTransformationFactory: Function<Direction,T>
  • freeTransformationFactory: IntFunction
  • segments: int

说明:

TODO

方法

下面的方法块按源码顺序生成。

public T wallTransformation(Direction facing) @ L25

  • 方法名:wallTransformation
  • 源码定位:L25
  • 返回类型:T
  • 修饰符:public

参数:

  • facing: Direction

说明:

TODO

public T freeTransformations(int segment) @ L29

  • 方法名:freeTransformations
  • 源码定位:L29
  • 返回类型:T
  • 修饰符:public

参数:

  • segment: int

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class WallAndGroundTransformations<T> {
    private final Map<Direction, T> wallTransforms;
    private final T[] freeTransformations;
 
    public WallAndGroundTransformations(Function<Direction, T> wallTransformationFactory, IntFunction<T> freeTransformationFactory, int segments) {
        this.wallTransforms = Util.makeEnumMap(Direction.class, wallTransformationFactory);
        this.freeTransformations = (T[])(new Object[segments]);
 
        for (int segment = 0; segment < segments; segment++) {
            this.freeTransformations[segment] = freeTransformationFactory.apply(segment);
        }
    }
 
    public T wallTransformation(Direction facing) {
        return this.wallTransforms.get(facing);
    }
 
    public T freeTransformations(int segment) {
        return this.freeTransformations[segment];
    }
}

引用的其他类

  • Direction

    • 引用位置: 参数/字段
  • Util

    • 引用位置: 方法调用
    • 关联成员: Util.makeEnumMap()