BannerModel.java

net.minecraft.client.model.object.banner.BannerModel

信息

  • 全限定名:net.minecraft.client.model.object.banner.BannerModel
  • 类型:public class
  • 包:net.minecraft.client.model.object.banner
  • 源码路径:src/main/java/net/minecraft/client/model/object/banner/BannerModel.java
  • 起始行号:L16
  • 继承:Model
  • 职责:

    TODO

字段/常量

  • BANNER_WIDTH

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

      TODO

  • BANNER_HEIGHT

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

      TODO

  • FLAG

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

      TODO

  • POLE

    • 类型: String
    • 修饰符: private static final
    • 源码定位: L20
    • 说明:

      TODO

  • BAR

    • 类型: String
    • 修饰符: private static final
    • 源码定位: L21
    • 说明:

      TODO

内部类/嵌套类型

构造器

public BannerModel(ModelPart root) @ L23

  • 构造器名:BannerModel
  • 源码定位:L23
  • 修饰符:public

参数:

  • root: ModelPart

说明:

TODO

方法

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

public static LayerDefinition createBodyLayer(boolean standing) @ L27

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

参数:

  • standing: boolean

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class BannerModel extends Model<Unit> {
    public static final int BANNER_WIDTH = 20;
    public static final int BANNER_HEIGHT = 40;
    public static final String FLAG = "flag";
    private static final String POLE = "pole";
    private static final String BAR = "bar";
 
    public BannerModel(ModelPart root) {
        super(root, RenderTypes::entitySolid);
    }
 
    public static LayerDefinition createBodyLayer(boolean standing) {
        MeshDefinition mesh = new MeshDefinition();
        PartDefinition root = mesh.getRoot();
        if (standing) {
            root.addOrReplaceChild("pole", CubeListBuilder.create().texOffs(44, 0).addBox(-1.0F, -42.0F, -1.0F, 2.0F, 42.0F, 2.0F), PartPose.ZERO);
        }
 
        root.addOrReplaceChild(
            "bar",
            CubeListBuilder.create().texOffs(0, 42).addBox(-10.0F, standing ? -44.0F : -20.5F, standing ? -1.0F : 9.5F, 20.0F, 2.0F, 2.0F),
            PartPose.ZERO
        );
        return LayerDefinition.create(mesh, 64, 64);
    }
}

引用的其他类

  • Model

    • 引用位置: 继承
  • ModelPart

    • 引用位置: 参数
  • CubeListBuilder

    • 引用位置: 方法调用
    • 关联成员: CubeListBuilder.create()
  • LayerDefinition

    • 引用位置: 方法调用/返回值
    • 关联成员: LayerDefinition.create()
  • MeshDefinition

    • 引用位置: 构造调用
    • 关联成员: MeshDefinition()