if (stack == null) return -1;
Item item = stack.getItem();
if (!(item instanceof ItemArmor)) return -1;
ItemArmor itemarmor = (ItemArmor)item;
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
textureManager.bindTexture(RenderBiped.getArmorResource(entity, stack, slot, null));
ModelBiped modelBiped = ForgeHooksClient.getArmorModel(entity, stack, slot, null);
setRenderPassModel(modelBiped);
if (modelBiped != null) {
modelBiped.onGround = mainModel.onGround;
modelBiped.isRiding = mainModel.isRiding;
modelBiped.isChild = mainModel.isChild;
}
int color = itemarmor.getColor(stack);
if (color != -1) {
RenderUtils.setColorFromInt(color);
if (stack.isItemEnchanted()) return 31;
return 16;
}