当前位置: 首页>>代码示例>>Java>>正文


Java ItemArmor.getColor方法代码示例

本文整理汇总了Java中net.minecraft.item.ItemArmor.getColor方法的典型用法代码示例。如果您正苦于以下问题:Java ItemArmor.getColor方法的具体用法?Java ItemArmor.getColor怎么用?Java ItemArmor.getColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.item.ItemArmor的用法示例。


在下文中一共展示了ItemArmor.getColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderLayer

import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
private void renderLayer(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float p_177182_4_, float p_177182_5_, float p_177182_6_, float p_177182_7_, float p_177182_8_, int armorSlot)
{
    ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot);

    if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
    {
        ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
        T t = this.func_177175_a(armorSlot);
        t.setModelAttributes(this.renderer.getMainModel());
        t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_4_);
        this.func_177179_a(t, armorSlot);
        boolean flag = this.isSlotForLeggings(armorSlot);
        this.renderer.bindTexture(this.getArmorResource(itemarmor, flag));

        switch (itemarmor.getArmorMaterial())
        {
            case LEATHER:
                int i = itemarmor.getColor(itemstack);
                float f = (float)(i >> 16 & 255) / 255.0F;
                float f1 = (float)(i >> 8 & 255) / 255.0F;
                float f2 = (float)(i & 255) / 255.0F;
                GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha);
                t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
                this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay"));

            case CHAIN:
            case IRON:
            case GOLD:
            case DIAMOND:
                GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha);
                t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);

            default:
                if (!this.field_177193_i && itemstack.isItemEnchanted())
                {
                    this.func_177183_a(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
                }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:41,代码来源:LayerArmorBase.java

示例2: armorHasOverlay

import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
public static boolean armorHasOverlay(ItemArmor p_armorHasOverlay_0_, ItemStack p_armorHasOverlay_1_)
{
    if (Reflector.ForgeItemArmor_hasOverlay.exists())
    {
        return Reflector.callBoolean(p_armorHasOverlay_0_, Reflector.ForgeItemArmor_hasOverlay, new Object[] {p_armorHasOverlay_1_});
    }
    else
    {
        int i = p_armorHasOverlay_0_.getColor(p_armorHasOverlay_1_);
        return i != 16777215;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:ReflectorForge.java

示例3: renderArmorLayer

import net.minecraft.item.ItemArmor; //导入方法依赖的package包/类
private void renderArmorLayer(EntityLivingBase entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn)
{
    ItemStack itemstack = this.getItemStackFromSlot(entityLivingBaseIn, slotIn);

    if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
    {
        ItemArmor itemarmor = (ItemArmor)itemstack.getItem();

        if (itemarmor.getEquipmentSlot() == slotIn)
        {
            T t = this.getModelFromSlot(slotIn);
            t = getArmorModelHook(entityLivingBaseIn, itemstack, slotIn, t);
            t.setModelAttributes(this.renderer.getMainModel());
            t.setLivingAnimations(entityLivingBaseIn, limbSwing, limbSwingAmount, partialTicks);
            this.setModelSlotVisible(t, slotIn);
            boolean flag = this.isLegSlot(slotIn);
            this.renderer.bindTexture(this.getArmorResource(entityLivingBaseIn, itemstack, slotIn, null));

            {
                if (itemarmor.hasOverlay(itemstack)) // Allow this for anything, not only cloth
                {
                    int i = itemarmor.getColor(itemstack);
                    float f = (float)(i >> 16 & 255) / 255.0F;
                    float f1 = (float)(i >> 8 & 255) / 255.0F;
                    float f2 = (float)(i & 255) / 255.0F;
                    GlStateManager.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha);
                    t.render(entityLivingBaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
                    this.renderer.bindTexture(this.getArmorResource(entityLivingBaseIn, itemstack, slotIn, "overlay"));
                }
                { // Non-colored
                    GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha);
                    t.render(entityLivingBaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
                } // Default
                    if (!this.skipRenderGlint && itemstack.hasEffect())
                    {
                        renderEnchantedGlint(this.renderer, entityLivingBaseIn, t, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
                    }
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:42,代码来源:LayerArmorBase.java


注:本文中的net.minecraft.item.ItemArmor.getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。