EntityModelSet.java

net.minecraft.client.model.geom.EntityModelSet

信息

  • 全限定名:net.minecraft.client.model.geom.EntityModelSet
  • 类型:public class
  • 包:net.minecraft.client.model.geom
  • 源码路径:src/main/java/net/minecraft/client/model/geom/EntityModelSet.java
  • 起始行号:L10
  • 职责:

    TODO

字段/常量

  • EMPTY

    • 类型: EntityModelSet
    • 修饰符: public static final
    • 源码定位: L11
    • 说明:

      TODO

  • roots

    • 类型: Map<ModelLayerLocation,LayerDefinition>
    • 修饰符: private final
    • 源码定位: L12
    • 说明:

      TODO

内部类/嵌套类型

构造器

public EntityModelSet(Map<ModelLayerLocation,LayerDefinition> roots) @ L14

  • 构造器名:EntityModelSet
  • 源码定位:L14
  • 修饰符:public

参数:

  • roots: Map<ModelLayerLocation,LayerDefinition>

说明:

TODO

方法

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

public ModelPart bakeLayer(ModelLayerLocation id) @ L18

  • 方法名:bakeLayer
  • 源码定位:L18
  • 返回类型:ModelPart
  • 修饰符:public

参数:

  • id: ModelLayerLocation

说明:

TODO

public static EntityModelSet vanilla() @ L27

  • 方法名:vanilla
  • 源码定位:L27
  • 返回类型:EntityModelSet
  • 修饰符:public static

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class EntityModelSet {
    public static final EntityModelSet EMPTY = new EntityModelSet(Map.of());
    private final Map<ModelLayerLocation, LayerDefinition> roots;
 
    public EntityModelSet(Map<ModelLayerLocation, LayerDefinition> roots) {
        this.roots = roots;
    }
 
    public ModelPart bakeLayer(ModelLayerLocation id) {
        LayerDefinition result = this.roots.get(id);
        if (result == null) {
            throw new IllegalArgumentException("No model for layer " + id);
        } else {
            return result.bakeRoot();
        }
    }
 
    public static EntityModelSet vanilla() {
        return new EntityModelSet(ImmutableMap.copyOf(LayerDefinitions.createRoots()));
    }
}

引用的其他类