本文整理汇总了Java中net.minecraft.item.EnumArmorMaterial.CLOTH属性的典型用法代码示例。如果您正苦于以下问题:Java EnumArmorMaterial.CLOTH属性的具体用法?Java EnumArmorMaterial.CLOTH怎么用?Java EnumArmorMaterial.CLOTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.item.EnumArmorMaterial
的用法示例。
在下文中一共展示了EnumArmorMaterial.CLOTH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_82813_b
public void func_82813_b(ItemStack p_82813_1_, int p_82813_2_) {
if(this.field_77878_bZ != EnumArmorMaterial.CLOTH) {
throw new UnsupportedOperationException("Can\'t dye non-leather!");
} else {
NBTTagCompound var3 = p_82813_1_.func_77978_p();
if(var3 == null) {
var3 = new NBTTagCompound();
p_82813_1_.func_77982_d(var3);
}
NBTTagCompound var4 = var3.func_74775_l("display");
if(!var3.func_74764_b("display")) {
var3.func_74766_a("display", var4);
}
var4.func_74768_a("color", p_82813_2_);
}
}
示例2: func_77569_a
public boolean func_77569_a(InventoryCrafting p_77569_1_, World p_77569_2_) {
ItemStack var3 = null;
ArrayList var4 = new ArrayList();
for(int var5 = 0; var5 < p_77569_1_.func_70302_i_(); ++var5) {
ItemStack var6 = p_77569_1_.func_70301_a(var5);
if(var6 != null) {
if(var6.func_77973_b() instanceof ItemArmor) {
ItemArmor var7 = (ItemArmor)var6.func_77973_b();
if(var7.func_82812_d() != EnumArmorMaterial.CLOTH || var3 != null) {
return false;
}
var3 = var6;
} else {
if(var6.field_77993_c != Item.field_77756_aW.field_77779_bT) {
return false;
}
var4.add(var6);
}
}
}
return var3 != null && !var4.isEmpty();
}
示例3: func_82814_b
public int func_82814_b(ItemStack p_82814_1_) {
if(this.field_77878_bZ != EnumArmorMaterial.CLOTH) {
return -1;
} else {
NBTTagCompound var2 = p_82814_1_.func_77978_p();
if(var2 == null) {
return 10511680;
} else {
NBTTagCompound var3 = var2.func_74775_l("display");
return var3 == null?10511680:(var3.func_74764_b("color")?var3.func_74762_e("color"):10511680);
}
}
}
示例4: func_82815_c
public void func_82815_c(ItemStack p_82815_1_) {
if(this.field_77878_bZ == EnumArmorMaterial.CLOTH) {
NBTTagCompound var2 = p_82815_1_.func_77978_p();
if(var2 != null) {
NBTTagCompound var3 = var2.func_74775_l("display");
if(var3.func_74764_b("color")) {
var3.func_82580_o("color");
}
}
}
}
示例5: func_94581_a
@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister p_94581_1_) {
super.func_94581_a(p_94581_1_);
if(this.field_77878_bZ == EnumArmorMaterial.CLOTH) {
this.field_94605_cw = p_94581_1_.func_94245_a(field_94606_cu[this.field_77881_a]);
}
this.field_94604_cx = p_94581_1_.func_94245_a(field_94603_a[this.field_77881_a]);
}
示例6: matches
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World)
{
ItemStack itemstack = null;
ArrayList arraylist = new ArrayList();
for (int i = 0; i < par1InventoryCrafting.getSizeInventory(); ++i)
{
ItemStack itemstack1 = par1InventoryCrafting.getStackInSlot(i);
if (itemstack1 != null)
{
if (itemstack1.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack1.getItem();
if (itemarmor.getArmorMaterial() != EnumArmorMaterial.CLOTH || itemstack != null)
{
return false;
}
itemstack = itemstack1;
}
else
{
if (itemstack1.itemID != Item.dyePowder.itemID)
{
return false;
}
arraylist.add(itemstack1);
}
}
}
return itemstack != null && !arraylist.isEmpty();
}
示例7: init
public static void init(){
itemHeart = new ItemHeart(ConfigHandler.itemHeart, "pickupHeart");
masterSword = new ItemWeaponBase(ConfigHandler.itemMasterSword, "masterSword");
dekuStick = new ItemDekuStick(ConfigHandler.dekuStick, "dekuStick");
lensOfTruth = new ItemTTP(ConfigHandler.itemLens, "lensOfTruth", false);
tunicZora = new ItemArmorTunic(1000, EnumArmorMaterial.CLOTH, "tunic.zora", ALttC.proxy.addArmor("zora"));
tunicGoron = new ItemArmorTunic(1001,EnumArmorMaterial.CLOTH, "tunic.goron", ALttC.proxy.addArmor("goron"));
}
示例8: func_77623_v
@SideOnly(Side.CLIENT)
public boolean func_77623_v() {
return this.field_77878_bZ == EnumArmorMaterial.CLOTH;
}
示例9: func_82816_b_
public boolean func_82816_b_(ItemStack p_82816_1_) {
return this.field_77878_bZ != EnumArmorMaterial.CLOTH?false:(!p_82816_1_.func_77942_o()?false:(!p_82816_1_.func_77978_p().func_74764_b("display")?false:p_82816_1_.func_77978_p().func_74775_l("display").func_74764_b("color")));
}
示例10: func_77572_b
public ItemStack func_77572_b(InventoryCrafting p_77572_1_) {
ItemStack var2 = null;
int[] var3 = new int[3];
int var4 = 0;
int var5 = 0;
ItemArmor var6 = null;
int var7;
int var9;
float var10;
float var11;
int var17;
for(var7 = 0; var7 < p_77572_1_.func_70302_i_(); ++var7) {
ItemStack var8 = p_77572_1_.func_70301_a(var7);
if(var8 != null) {
if(var8.func_77973_b() instanceof ItemArmor) {
var6 = (ItemArmor)var8.func_77973_b();
if(var6.func_82812_d() != EnumArmorMaterial.CLOTH || var2 != null) {
return null;
}
var2 = var8.func_77946_l();
var2.field_77994_a = 1;
if(var6.func_82816_b_(var8)) {
var9 = var6.func_82814_b(var2);
var10 = (float)(var9 >> 16 & 255) / 255.0F;
var11 = (float)(var9 >> 8 & 255) / 255.0F;
float var12 = (float)(var9 & 255) / 255.0F;
var4 = (int)((float)var4 + Math.max(var10, Math.max(var11, var12)) * 255.0F);
var3[0] = (int)((float)var3[0] + var10 * 255.0F);
var3[1] = (int)((float)var3[1] + var11 * 255.0F);
var3[2] = (int)((float)var3[2] + var12 * 255.0F);
++var5;
}
} else {
if(var8.field_77993_c != Item.field_77756_aW.field_77779_bT) {
return null;
}
float[] var14 = EntitySheep.field_70898_d[BlockColored.func_72238_e_(var8.func_77960_j())];
int var16 = (int)(var14[0] * 255.0F);
int var15 = (int)(var14[1] * 255.0F);
var17 = (int)(var14[2] * 255.0F);
var4 += Math.max(var16, Math.max(var15, var17));
var3[0] += var16;
var3[1] += var15;
var3[2] += var17;
++var5;
}
}
}
if(var6 == null) {
return null;
} else {
var7 = var3[0] / var5;
int var13 = var3[1] / var5;
var9 = var3[2] / var5;
var10 = (float)var4 / (float)var5;
var11 = (float)Math.max(var7, Math.max(var13, var9));
var7 = (int)((float)var7 * var10 / var11);
var13 = (int)((float)var13 * var10 / var11);
var9 = (int)((float)var9 * var10 / var11);
var17 = (var7 << 8) + var13;
var17 = (var17 << 8) + var9;
var6.func_82813_b(var2, var17);
return var2;
}
}
示例11: func_71903_a
public boolean func_71903_a(World p_71903_1_, int p_71903_2_, int p_71903_3_, int p_71903_4_, EntityPlayer p_71903_5_, int p_71903_6_, float p_71903_7_, float p_71903_8_, float p_71903_9_) {
if(p_71903_1_.field_72995_K) {
return true;
} else {
ItemStack var10 = p_71903_5_.field_71071_by.func_70448_g();
if(var10 == null) {
return true;
} else {
int var11 = p_71903_1_.func_72805_g(p_71903_2_, p_71903_3_, p_71903_4_);
int var12 = func_111045_h_(var11);
if(var10.field_77993_c == Item.field_77786_ax.field_77779_bT) {
if(var12 < 3) {
if(!p_71903_5_.field_71075_bZ.field_75098_d) {
p_71903_5_.field_71071_by.func_70299_a(p_71903_5_.field_71071_by.field_70461_c, new ItemStack(Item.field_77788_aw));
}
p_71903_1_.func_72921_c(p_71903_2_, p_71903_3_, p_71903_4_, 3, 2);
p_71903_1_.func_96440_m(p_71903_2_, p_71903_3_, p_71903_4_, this.field_71990_ca);
}
return true;
} else {
if(var10.field_77993_c == Item.field_77729_bt.field_77779_bT) {
if(var12 > 0) {
ItemStack var13 = new ItemStack(Item.field_77726_bs, 1, 0);
if(!p_71903_5_.field_71071_by.func_70441_a(var13)) {
p_71903_1_.func_72838_d(new EntityItem(p_71903_1_, (double)p_71903_2_ + 0.5D, (double)p_71903_3_ + 1.5D, (double)p_71903_4_ + 0.5D, var13));
} else if(p_71903_5_ instanceof EntityPlayerMP) {
((EntityPlayerMP)p_71903_5_).func_71120_a(p_71903_5_.field_71069_bz);
}
--var10.field_77994_a;
if(var10.field_77994_a <= 0) {
p_71903_5_.field_71071_by.func_70299_a(p_71903_5_.field_71071_by.field_70461_c, (ItemStack)null);
}
p_71903_1_.func_72921_c(p_71903_2_, p_71903_3_, p_71903_4_, var12 - 1, 2);
p_71903_1_.func_96440_m(p_71903_2_, p_71903_3_, p_71903_4_, this.field_71990_ca);
}
} else if(var12 > 0 && var10.func_77973_b() instanceof ItemArmor && ((ItemArmor)var10.func_77973_b()).func_82812_d() == EnumArmorMaterial.CLOTH) {
ItemArmor var14 = (ItemArmor)var10.func_77973_b();
var14.func_82815_c(var10);
p_71903_1_.func_72921_c(p_71903_2_, p_71903_3_, p_71903_4_, var12 - 1, 2);
p_71903_1_.func_96440_m(p_71903_2_, p_71903_3_, p_71903_4_, this.field_71990_ca);
return true;
}
return true;
}
}
}
}
示例12: func_77107_a
protected int func_77107_a(AbstractClientPlayer p_77107_1_, int p_77107_2_, float p_77107_3_) {
ItemStack var4 = p_77107_1_.field_71071_by.func_70440_f(3 - p_77107_2_);
if(var4 != null) {
Item var5 = var4.func_77973_b();
if(var5 instanceof ItemArmor) {
ItemArmor var6 = (ItemArmor)var5;
this.func_110776_a(RenderBiped.func_110857_a(var6, p_77107_2_));
ModelBiped var7 = p_77107_2_ == 2?this.field_77111_i:this.field_77108_b;
var7.field_78116_c.field_78806_j = p_77107_2_ == 0;
var7.field_78114_d.field_78806_j = p_77107_2_ == 0;
var7.field_78115_e.field_78806_j = p_77107_2_ == 1 || p_77107_2_ == 2;
var7.field_78112_f.field_78806_j = p_77107_2_ == 1;
var7.field_78113_g.field_78806_j = p_77107_2_ == 1;
var7.field_78123_h.field_78806_j = p_77107_2_ == 2 || p_77107_2_ == 3;
var7.field_78124_i.field_78806_j = p_77107_2_ == 2 || p_77107_2_ == 3;
this.func_77042_a(var7);
var7.field_78095_p = this.field_77045_g.field_78095_p;
var7.field_78093_q = this.field_77045_g.field_78093_q;
var7.field_78091_s = this.field_77045_g.field_78091_s;
float var8 = 1.0F;
if(var6.func_82812_d() == EnumArmorMaterial.CLOTH) {
int var9 = var6.func_82814_b(var4);
float var10 = (float)(var9 >> 16 & 255) / 255.0F;
float var11 = (float)(var9 >> 8 & 255) / 255.0F;
float var12 = (float)(var9 & 255) / 255.0F;
GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12);
if(var4.func_77948_v()) {
return 31;
}
return 16;
}
GL11.glColor3f(var8, var8, var8);
if(var4.func_77948_v()) {
return 15;
}
return 1;
}
}
return -1;
}
示例13: func_130006_a
protected int func_130006_a(EntityLiving p_130006_1_, int p_130006_2_, float p_130006_3_) {
ItemStack var4 = p_130006_1_.func_130225_q(3 - p_130006_2_);
if(var4 != null) {
Item var5 = var4.func_77973_b();
if(var5 instanceof ItemArmor) {
ItemArmor var6 = (ItemArmor)var5;
this.func_110776_a(func_110857_a(var6, p_130006_2_));
ModelBiped var7 = p_130006_2_ == 2?this.field_82425_h:this.field_82423_g;
var7.field_78116_c.field_78806_j = p_130006_2_ == 0;
var7.field_78114_d.field_78806_j = p_130006_2_ == 0;
var7.field_78115_e.field_78806_j = p_130006_2_ == 1 || p_130006_2_ == 2;
var7.field_78112_f.field_78806_j = p_130006_2_ == 1;
var7.field_78113_g.field_78806_j = p_130006_2_ == 1;
var7.field_78123_h.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
var7.field_78124_i.field_78806_j = p_130006_2_ == 2 || p_130006_2_ == 3;
this.func_77042_a(var7);
var7.field_78095_p = this.field_77045_g.field_78095_p;
var7.field_78093_q = this.field_77045_g.field_78093_q;
var7.field_78091_s = this.field_77045_g.field_78091_s;
float var8 = 1.0F;
if(var6.func_82812_d() == EnumArmorMaterial.CLOTH) {
int var9 = var6.func_82814_b(var4);
float var10 = (float)(var9 >> 16 & 255) / 255.0F;
float var11 = (float)(var9 >> 8 & 255) / 255.0F;
float var12 = (float)(var9 & 255) / 255.0F;
GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12);
if(var4.func_77948_v()) {
return 31;
}
return 16;
}
GL11.glColor3f(var8, var8, var8);
if(var4.func_77948_v()) {
return 15;
}
return 1;
}
}
return -1;
}
示例14: onBlockActivated
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem();
if (itemstack == null)
{
return true;
}
else
{
int i1 = par1World.getBlockMetadata(par2, par3, par4);
int j1 = func_111045_h_(i1);
if (itemstack.itemID == Item.bucketWater.itemID)
{
if (j1 < 3)
{
if (!par5EntityPlayer.capabilities.isCreativeMode)
{
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
par1World.func_96440_m(par2, par3, par4, this.blockID);
}
return true;
}
else
{
if (itemstack.itemID == Item.glassBottle.itemID)
{
if (j1 > 0)
{
ItemStack itemstack1 = new ItemStack(Item.potion, 1, 0);
if (!par5EntityPlayer.inventory.addItemStackToInventory(itemstack1))
{
par1World.spawnEntityInWorld(new EntityItem(par1World, (double)par2 + 0.5D, (double)par3 + 1.5D, (double)par4 + 0.5D, itemstack1));
}
else if (par5EntityPlayer instanceof EntityPlayerMP)
{
((EntityPlayerMP)par5EntityPlayer).sendContainerToPlayer(par5EntityPlayer.inventoryContainer);
}
--itemstack.stackSize;
if (itemstack.stackSize <= 0)
{
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, j1 - 1, 2);
par1World.func_96440_m(par2, par3, par4, this.blockID);
}
}
else if (j1 > 0 && itemstack.getItem() instanceof ItemArmor && ((ItemArmor)itemstack.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH)
{
ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
itemarmor.removeColor(itemstack);
par1World.setBlockMetadataWithNotify(par2, par3, par4, j1 - 1, 2);
par1World.func_96440_m(par2, par3, par4, this.blockID);
return true;
}
return true;
}
}
}
}
示例15: ItemArmorApiarist
public ItemArmorApiarist(int id, int slot) {
super(id, EnumArmorMaterial.CLOTH, 0, slot);
this.setMaxDamage(100);
this.setTextureFile(Defaults.TEXTURE_ITEMS);
setCreativeTab(Tabs.tabApiculture);
}