/* * Decompiled with CFR 0.152. */ package net.minecraft.client.model; import net.minecraft.client.model.Model; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.LayerDefinition; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; import net.minecraft.client.renderer.rendertype.RenderTypes; import net.minecraft.util.Unit; public class ShieldModel extends Model { private static final String PLATE = "plate"; private static final String HANDLE = "handle"; private static final int SHIELD_WIDTH = 10; private static final int SHIELD_HEIGHT = 20; private final ModelPart plate; private final ModelPart handle; public ShieldModel(ModelPart root) { super(root, RenderTypes::entitySolid); this.plate = root.getChild(PLATE); this.handle = root.getChild(HANDLE); } public static LayerDefinition createLayer() { MeshDefinition mesh = new MeshDefinition(); PartDefinition root = mesh.getRoot(); root.addOrReplaceChild(PLATE, CubeListBuilder.create().texOffs(0, 0).addBox(-6.0f, -11.0f, -2.0f, 12.0f, 22.0f, 1.0f), PartPose.ZERO); root.addOrReplaceChild(HANDLE, CubeListBuilder.create().texOffs(26, 0).addBox(-1.0f, -3.0f, -1.0f, 2.0f, 6.0f, 6.0f), PartPose.ZERO); return LayerDefinition.create(mesh, 64, 64); } public ModelPart plate() { return this.plate; } public ModelPart handle() { return this.handle; } }