本文整理匯總了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_);
}
}
}
}
示例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;
}
}
示例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);
}
}
}
}
}