本文整理汇总了Java中net.minecraft.item.EnumArmorMaterial类的典型用法代码示例。如果您正苦于以下问题:Java EnumArmorMaterial类的具体用法?Java EnumArmorMaterial怎么用?Java EnumArmorMaterial使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnumArmorMaterial类属于net.minecraft.item包,在下文中一共展示了EnumArmorMaterial类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ItemArmourMFOld
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public ItemArmourMFOld(int i, ArmourDesign design, EnumArmorMaterial mat, int render, int type, String s) {
super(i, mat, render, type);
AD = design;
if(isBasicMaterial(design, mat))
setCreativeTab(CreativeTabs.tabCombat);
else
setCreativeTab(ItemListMF.tabArmour);
material = mat;
file = s;
armourType = type;
renderIndex = render;
damageReduceAmount = mat.getDamageReductionAmount(type);
setMaxDamage(mat.getDurability(type));
maxStackSize = 1;
}
示例2: func_82813_b
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
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_);
}
}
示例3: func_77569_a
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
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();
}
示例4: initItems
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public static void initItems()
{
meteorSpawner = new ItemMeteorSpawner(ConfigHelper.MeteorSpawnerID).setUnlocalizedName("MeteorSpawner");
EnumToolMaterial meteor = EnumHelper.addToolMaterial("Meteoritic", 3, -1, 16, 14, 30);
meteoriticPickaxe = new ItemMeteoriticPickaxe(ConfigHelper.MeteoriticPickaxeID, meteor).setUnlocalizedName("MeteoriticPickaxe");
meteoriticAxe = new ItemMeteoriticAxe(ConfigHelper.MeteoriticAxeID, meteor).setUnlocalizedName("MeteoriticAxe");
meteoriticShovel = new ItemMeteoriticShovel(ConfigHelper.MeteoriticShovelID, meteor).setUnlocalizedName("MeteoriticShovel");
meteoriticSword = new ItemMeteoriticSword(ConfigHelper.MeteoriticSwordID, meteor).setUnlocalizedName("MeteoriticSword");
int meteoriticArmor = FallingEarth.proxy.addArmor("FallingEarth:Meteor");
EnumArmorMaterial meteoritic = EnumHelper.addArmorMaterial("Meteoritic", -1, new int[]{0,0,0,0}, 30);
meteoriticHead = new ItemMeteoriticArmor(ConfigHelper.MeteoriticHeadID, meteoritic, meteoriticArmor, 0).setUnlocalizedName("FallingEarth:MeteoriticHelmet");
meteoriticBody = new ItemMeteoriticArmor(ConfigHelper.MeteoriticBodyID, meteoritic, meteoriticArmor, 1).setUnlocalizedName("FallingEarth:MeteoriticBody");
meteoriticLegs = new ItemMeteoriticArmor(ConfigHelper.MeteoriticLegsID, meteoritic, meteoriticArmor, 2).setUnlocalizedName("FallingEarth:MeteoriticLegs");
meteoriticBoots = new ItemMeteoriticArmor(ConfigHelper.MeteoriticBootsID, meteoritic, meteoriticArmor, 3).setUnlocalizedName("FallingEarth:MeteoriticBoots");
meteoriticEssence = new MeteoriticEssence(ConfigHelper.MeteoriticEssenceID).setUnlocalizedName("MeteoriticEssence");
}
示例5: GGUArmor
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public GGUArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,
int par3, int par4) {
super(par1, par2EnumArmorMaterial, par3, par4);
if(par1==ConfigManager.helmet)
this.setTextureName("piggalot:pigtite_helmet");
if(par1==ConfigManager.chestplate)
this.setTextureName("piggalot:pigtite_chestplate");
if(par1==ConfigManager.boots)
this.setTextureName("piggalot:pigtite_boots");
if(par1==ConfigManager.leggings)
this.setTextureName("piggalot:pigtite_leggings");
this.setCreativeTab(Piggalot.piggalottab);
}
示例6: getClassFor
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public static EnumArmourClass getClassFor(ItemStack armour)
{
if(armour == null)
{
return EnumArmourClass.UNARMOURED;
}
EnumArmourClass AC = EnumArmourClass.HEAVY;
if(armour.itemID == Item.helmetLeather.itemID || armour.itemID == Item.plateLeather.itemID || armour.itemID == Item.legsLeather.itemID || armour.itemID == Item.bootsLeather.itemID)
{
AC = EnumArmourClass.LIGHT;
}
else if(armour.getItem().getClass().getName().endsWith("MoCItemArmor"))
{
AC = EnumArmourClass.LIGHT;
}
else if(armour.itemID == Item.helmetChain.itemID || armour.itemID == Item.plateChain.itemID || armour.itemID == Item.legsChain.itemID || armour.itemID == Item.bootsChain.itemID)
{
AC = EnumArmourClass.MEDIUM;
}
else if(armour.getItem() instanceof IArmourClass)
{
AC = ((IArmourClass)armour.getItem()).getArmourClass();
}
else
{
if(armour.getItem() != null && armour.getItem() instanceof ItemArmor)
{
EnumArmorMaterial material = ((ItemArmor)armour.getItem()).getArmorMaterial();
AC = getClassOf(material, AC);
}
}
AC = minefantasy.api.armour.ArmourWeightClass.getClassFor(armour, AC);
return AC;
}
示例7: ItemSmartHelmet
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public ItemSmartHelmet(int id) {
super(id, EnumArmorMaterial.IRON, 0, 0);
setMaxDamage(0);
setCreativeTab(MiscPeripherals.instance.tabMiscPeripherals);
fwFontRenderer = Reflector.invoke("dan200.ComputerCraft", "getFixedWidthFontRenderer", Object.class);
SmallNetHelper.bindEntity(EntityPlayerMP.class, this);
}
示例8: ItemNileArmor
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public ItemNileArmor(int par1, EnumArmorMaterial nileEssenceMaterial2, int par3, int par4, String type) {
super(par1, nileEssenceMaterial2, par3, par4);
this.maxStackSize = 1;
this.setCreativeTab(ZeroQuest.ZeroTab);
this.setTextureName(type, par4);
}
示例9: preInit
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
loadConfig(event.getSuggestedConfigurationFile());
enderiumHelm = new ItemArmorEnderium(starterID++, EnumArmorMaterial.DIAMOND, ItemArmorEnderium.ArmorType.HELMET);
enderiumChest = new ItemArmorEnderium(starterID++, EnumArmorMaterial.DIAMOND, ItemArmorEnderium.ArmorType.CHESTPLATE);
enderiumLegs = new ItemArmorEnderium(starterID++, EnumArmorMaterial.DIAMOND, ItemArmorEnderium.ArmorType.LEGS);
enderiumBoots = new ItemArmorEnderium(starterID++, EnumArmorMaterial.DIAMOND, ItemArmorEnderium.ArmorType.BOOTS);
GameRegistry.registerItem(enderiumHelm, "enderiumHelm");
GameRegistry.registerItem(enderiumChest, "enderiumChest");
GameRegistry.registerItem(enderiumLegs, "enderiumLegs");
GameRegistry.registerItem(enderiumBoots, "enderiumBoots");
}
示例10: ItemArmorEnderium
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public ItemArmorEnderium(int id, EnumArmorMaterial material, ArmorType type)
{
super(id, material, 0, type.ordinal());
String texture = "", unlocalized = "";
this.type = type;
switch (type)
{
case BOOTS:
texture = "enderiumpowerarmor:armorEnderiumBoots";
unlocalized = "enderium.boots";
break;
case CHESTPLATE:
texture = "enderiumpowerarmor:armorEnderiumChestplate";
unlocalized = "enderium.chest";
break;
case HELMET:
texture = "enderiumpowerarmor:armorEnderiumHelmet";
unlocalized = "enderium.helmet";
break;
case LEGS:
texture = "enderiumpowerarmor:armorEnderiumLegs";
unlocalized = "enderium.legs";
break;
}
setTextureName(texture);
setCreativeTab(ThermalExpansion.tabItems);
setUnlocalizedName(unlocalized);
setMaxStackSize(1);
setMaxDamage(101);
}
示例11: ItemArmor
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
public ItemArmor(int p_i1828_1_, EnumArmorMaterial p_i1828_2_, int p_i1828_3_, int p_i1828_4_) {
super(p_i1828_1_);
this.field_77878_bZ = p_i1828_2_;
this.field_77881_a = p_i1828_4_;
this.field_77880_c = p_i1828_3_;
this.field_77879_b = p_i1828_2_.func_78044_b(p_i1828_4_);
this.func_77656_e(p_i1828_2_.func_78046_a(p_i1828_4_));
this.field_77777_bU = 1;
this.func_77637_a(CreativeTabs.field_78037_j);
BlockDispenser.field_82527_a.func_82595_a(this, field_96605_cw);
}
示例12: func_82814_b
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
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);
}
}
}
示例13: func_82815_c
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
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");
}
}
}
}
示例14: func_94581_a
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
@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]);
}
示例15: matches
import net.minecraft.item.EnumArmorMaterial; //导入依赖的package包/类
/**
* 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();
}