extend("skarredheroes:halo");
loadTextures({
    "layer1": "skarredheroes:halo/halo_2020_layer1",
    "layer2": "skarredheroes:halo/halo_2020_layer2",
	"pants_chest": "skarredheroes:halo/halo_2020_pants_chest",
	"boots": "skarredheroes:halo/halo_2020_boots",
	"lights": "skarredheroes:halo/halo_2020_lights.tx.json"
});

function init(renderer) {
    parent.init(renderer);
    renderer.setItemIcons("halo_0", "%s_1", "%s_2", "%s_3");
    renderer.setTexture((entity, renderLayer) => {
        if (renderLayer == "LEGGINGS") {
            return entity.getWornChestplate().suitType() == $SUIT_NAME ? "pants_chest" : "layer2";
        }
        else if (renderLayer == "BOOTS") {
            return "boots";
        }
        return "layer1";
    });

    renderer.showModel("HELMET", "head", "headwear");
    renderer.showModel("CHESTPLATE", "body", "rightArm", "leftArm", "rightLeg", "leftLeg");
    renderer.showModel("LEGGINGS", "body", "rightLeg", "leftLeg");
    renderer.showModel("BOOTS", "rightLeg", "leftLeg");
    renderer.fixHatLayer("HELMET");
}