Search in sources :

Example 1 with ColorObj

use of de.sanandrew.mods.sanlib.lib.ColorObj in project ClaySoldiersMod by SanAndreasP.

the class LayerLeatherArmor method doRenderLayer.

@Override
public void doRenderLayer(EntityCreature creature, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (!(creature instanceof ISoldier)) {
        return;
    }
    ISoldier soldier = (ISoldier) creature;
    if (soldier.hasUpgrade(Upgrades.MC_LEATHER, EnumUpgradeType.MISC)) {
        this.renderModel(this.modelLeatherArmor, scale);
    } else if (soldier.hasUpgrade(Upgrades.MC_RABBITHIDE, EnumUpgradeType.MISC)) {
        this.renderModel(this.modelRabbitHide, scale);
    }
    ISoldierUpgradeInst woolInst = soldier.getUpgradeInstance(Upgrades.EM_WOOL, EnumUpgradeType.ENHANCEMENT);
    if (woolInst != null) {
        ColorObj cObj = new ColorObj(EnumDyeColor.byMetadata(woolInst.getNbtData().getInteger("color")).getColorValue());
        GlStateManager.color(cObj.fRed(), cObj.fGreen(), cObj.fBlue());
        this.renderModel(this.modelPadding, scale);
        GlStateManager.color(1.0F, 1.0F, 1.0F);
    }
}
Also used : ISoldierUpgradeInst(de.sanandrew.mods.claysoldiers.api.soldier.upgrade.ISoldierUpgradeInst) ColorObj(de.sanandrew.mods.sanlib.lib.ColorObj) ISoldier(de.sanandrew.mods.claysoldiers.api.soldier.ISoldier)

Aggregations

ISoldier (de.sanandrew.mods.claysoldiers.api.soldier.ISoldier)1 ISoldierUpgradeInst (de.sanandrew.mods.claysoldiers.api.soldier.upgrade.ISoldierUpgradeInst)1 ColorObj (de.sanandrew.mods.sanlib.lib.ColorObj)1