2025-11-24 22:52:51 +03:00

39 lines
1.5 KiB
Java

/*
* 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 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);
}
}