Search in sources :

Example 1 with ISpecialGear

use of mekanism.common.item.interfaces.ISpecialGear in project Mekanism by mekanism.

the class MekanismArmorLayer method renderArmorPart.

private void renderArmorPart(MatrixStack matrix, IRenderTypeBuffer renderer, T entity, EquipmentSlotType slot, int light, float partialTicks) {
    ItemStack stack = entity.getItemBySlot(slot);
    Item item = stack.getItem();
    if (item instanceof ISpecialGear && item instanceof ArmorItem) {
        ArmorItem armorItem = (ArmorItem) item;
        if (armorItem.getSlot() == slot) {
            CustomArmor model = ((ISpecialGear) item).getGearModel();
            getParentModel().copyPropertiesTo((BipedModel<T>) model);
            setPartVisibility((A) model, slot);
            model.render(matrix, renderer, light, OverlayTexture.NO_OVERLAY, partialTicks, stack.hasFoil(), entity, stack);
        }
    }
}
Also used : Item(net.minecraft.item.Item) ArmorItem(net.minecraft.item.ArmorItem) CustomArmor(mekanism.client.render.armor.CustomArmor) ArmorItem(net.minecraft.item.ArmorItem) ISpecialGear(mekanism.common.item.interfaces.ISpecialGear) ItemStack(net.minecraft.item.ItemStack)

Aggregations

CustomArmor (mekanism.client.render.armor.CustomArmor)1 ISpecialGear (mekanism.common.item.interfaces.ISpecialGear)1 ArmorItem (net.minecraft.item.ArmorItem)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1