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


Java ArmorMaterial类代码示例

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


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

示例1: applyBackers

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public static void applyBackers(List<MaterialDefinition> definitions) {
    for (MaterialDefinition definition : definitions) {
        ToolMaterial toolMaterial = definition.getToolMaterial();
        ArmorMaterial armorMaterial = definition.getArmorMaterial();

        RandoresItemData itemData = definition.getData();

        RandoresItems.hoe.registerBacker(itemData, new ItemHoe(toolMaterial));
        RandoresItems.sword.registerBacker(itemData, new ItemSword(toolMaterial));
        RandoresItems.axe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 5f, -3f));
        RandoresItems.shovel.registerBacker(itemData, new ItemSpade(toolMaterial));
        RandoresItems.pickaxe.registerBacker(itemData, new ConstructablePickaxe(toolMaterial));
        RandoresItems.battleaxe.registerBacker(itemData, new ConstructableAxe(toolMaterial, toolMaterial.getDamageVsEntity() + 8f, -3.5f));
        RandoresItems.helmet.registerBacker(itemData, armorMaterial);
        RandoresItems.chestplate.registerBacker(itemData, armorMaterial);
        RandoresItems.leggings.registerBacker(itemData, armorMaterial);
        RandoresItems.boots.registerBacker(itemData, armorMaterial);
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:20,代码来源:MaterialDefinitionGenerator.java

示例2: ItemCGArmor

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public ItemCGArmor(String id, ArmorMaterial armorMaterial, String armorName, int renderIndex, EntityEquipmentSlot armorType)
{
	super(armorMaterial, renderIndex, armorType);

	this.armorName = armorName;
	this.itemClass = EnumItemClass.MEDIUM_ARMOR;
	this.isAirMask = false;
	this.minAirToStartRefil = 0;
	this.rarity = EnumRarity.COMMON;
	
	setUnlocalizedName(id);
	
	ItemsCG.registerItem(this, new ResourceLocation(ModInfo.MODID, id)); // Put into registry.

	if (CompositeGear.ic2Tab != null) {
		setCreativeTab(CompositeGear.ic2Tab);
	}
}
 
开发者ID:TwilightWingsStudio,项目名称:CompositeGear,代码行数:19,代码来源:ItemCGArmor.java

示例3: registerPurpleMaterial

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
private static void registerPurpleMaterial() {
  ArmorMaterial mimicArmor = ArmorMaterial.DIAMOND;
  MaterialRegistry.powerArmorMaterial = EnumHelper.addArmorMaterial(MATERIALNAME, Const.MODRES + MATERIALNAME,
      diamondDurability * 2, // affects DURABILITY . 15 is the same as iron
      new int[] {
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.FEET) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.LEGS) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.CHEST) + 1,
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.HEAD) + 2
      },
      mimicArmor.getEnchantability() / 4,
      mimicArmor.getSoundEvent(),
      mimicArmor.getToughness() + 2);
  MaterialRegistry.powerArmorMaterial.repairMaterial = new ItemStack(Blocks.OBSIDIAN);
  //now the tool material
  MaterialRegistry.powerToolMaterial = EnumHelper.addToolMaterial(MATERIALNAME,
      ToolMaterial.DIAMOND.getHarvestLevel(),
      ToolMaterial.DIAMOND.getMaxUses() * 4, //was  - 261
      ToolMaterial.DIAMOND.getEfficiencyOnProperMaterial(),
      ToolMaterial.DIAMOND.getDamageVsEntity() * 8, //best draconic evolution sword is 35 base, so this is not that crazy
      ToolMaterial.GOLD.getEnchantability() * 2);
  MaterialRegistry.powerToolMaterial.setRepairItem(MaterialRegistry.powerArmorMaterial.repairMaterial);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:24,代码来源:MaterialRegistry.java

示例4: registerEmeraldMaterial

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
private static void registerEmeraldMaterial() {
  MaterialRegistry.emeraldArmorMaterial = EnumHelper.addArmorMaterial(emeraldName, Const.MODRES + emeraldName,
      diamondDurability + 30, //was -2 affects DURABILITY 
      new int[] {
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.FEET),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.LEGS),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.CHEST),
          ArmorMaterial.DIAMOND.getDamageReductionAmount(EntityEquipmentSlot.HEAD)
      },
      ArmorMaterial.GOLD.getEnchantability(),
      ArmorMaterial.DIAMOND.getSoundEvent(),
      ArmorMaterial.DIAMOND.getToughness() + 1);//was  / 2
  MaterialRegistry.emeraldArmorMaterial.repairMaterial = new ItemStack(Items.EMERALD);
  //max uses is durability ex The number of uses this material allows.
  //as of 1.9.4 :  (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
  MaterialRegistry.emeraldToolMaterial = EnumHelper.addToolMaterial(emeraldName,
      ToolMaterial.DIAMOND.getHarvestLevel(),
      ToolMaterial.DIAMOND.getMaxUses(), //was  - 261
      ToolMaterial.DIAMOND.getEfficiencyOnProperMaterial(),
      ToolMaterial.DIAMOND.getDamageVsEntity(), //was  - 0.25F
      ToolMaterial.GOLD.getEnchantability());
  MaterialRegistry.emeraldToolMaterial.setRepairItem(MaterialRegistry.emeraldArmorMaterial.repairMaterial);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:24,代码来源:MaterialRegistry.java

示例5: registerMaterial

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
protected static void registerMaterial(String name, MetalMaterial m){

		allMaterials.put(name, m);
		
		String enumName = m.getEnumName();
		String texName = m.getName();
		int[] protection = m.getDamageReductionArray();
		int durability = m.getArmorMaxDamageFactor();
		ArmorMaterial am = EnumHelper.addArmorMaterial(enumName, texName, durability, protection, m.getEnchantability(), SoundEvents.ITEM_ARMOR_EQUIP_IRON, (m.hardness > 10 ? (int)(m.hardness / 5) : 0));
		if(am == null){
			// uh-oh
			FMLLog.severe("Failed to create armor material enum for "+m);
		}
		armorMaterialMap.put(m, am);
		FMLLog.info("Created armor material enum "+am);
		
		ToolMaterial tm = EnumHelper.addToolMaterial(enumName, m.getToolHarvestLevel(), m.getToolDurability(), m.getToolEfficiency(), m.getBaseAttackDamage(), m.getEnchantability());
		if(tm == null){
			// uh-oh
			FMLLog.severe("Failed to create tool material enum for "+m);
		}
		toolMaterialMap.put(m, tm);
		FMLLog.info("Created tool material enum "+tm);
	}
 
开发者ID:cyanobacterium,项目名称:BaseMetals,代码行数:25,代码来源:Materials.java

示例6: getArmorExtraHealthBoost

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public static int getArmorExtraHealthBoost(ItemStack stack) {
	if (stack != null && stack.getItem() instanceof ItemArmor) {
		ArmorMaterial armmat = ((ItemArmor)stack.getItem()).getArmorMaterial();
		String name = armmat.name().toLowerCase(Locale.ROOT);
		
		if (name.equals("leather")) {
			return 2;
		}
		if (name.equals("coppervc")) {
			return 3; 
		}
		if (name.equals("tinbronzevc")) {
			return 4;
		}
		if (name.equals("bismuthbronzevc")) {
			return 4;
		}
		if (name.equals("ironvc")) {
			return 5;
		}
		
		//System.out.println("armor material " + name + " not found");
		
	}
	return 0;
}
 
开发者ID:tyronx,项目名称:vintagecraft,代码行数:27,代码来源:MobInventoryItems.java

示例7: fromMCArmorMaterial

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
private static ItemType fromMCArmorMaterial(ArmorMaterial material) {
    switch (material) {
        case DIAMOND:
            return ItemType.DIAMOND;
        case IRON:
        case CHAIN:
            return ItemType.IRON_INGOT;
        case GOLD:
            return ItemType.GOLD_INGOT;
        case LEATHER:
            return ItemType.LEATHER;
        default:
            throw new CIE("This piece of armor is made of a material that I don't recognize! Is Corundum running with a Minecraft server version higher than "
                    + CorundumServer.getInstance().getMCVersion() + "?", "unidentified tool material", "material=" + material.toString());
    }
}
 
开发者ID:asusoda,项目名称:Corundum,代码行数:17,代码来源:Item.java

示例8: onEquippedOrLoadedIntoWorld

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
@Override
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
	
	attributes.clear();
	armorCount = 0;
	for (ItemStack armor : ((EntityPlayer)player).inventory.armorInventory) {
		if (armor != null && armor.getItem() instanceof ItemArmor) {
			if (((ItemArmor)armor.getItem()).getArmorMaterial() != ArmorMaterial.LEATHER)
				armorCount++;
		}
	}
	fillModifiers(attributes, stack);
	player.getAttributeMap().applyAttributeModifiers(attributes);
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:15,代码来源:EmblemLeaf.java

示例9: ItemSetArmour

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public ItemSetArmour(String texturePrefix, ArmorMaterial material) {
	this.texturePrefix = texturePrefix;
	this.material = material;
	
	this.helmet = new ItemArmour(material.name() + "Helmet", 7, 0);
	this.chestplate = new ItemArmour(material.name()  + "Chestplate", 7, 1);
	this.leggings = new ItemArmour(material.name()  + "Leggings", 7, 2);
	this.boots = new ItemArmour(material.name()  + "Boots", 7, 3);
	
	try {
		registerRenderer();
	} catch(NoSuchMethodError e) {
	//	e.printStackTrace();
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:ItemSetArmour.java

示例10: renderArmor

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
private void renderArmor(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot armorSlot) {
    ItemStack itemstack = entity.getItemStackFromSlot(armorSlot);

    if (!itemstack.isEmpty() && itemstack.getItem() instanceof ItemArmor) {

        ItemArmor itemarmor = (ItemArmor) itemstack.getItem();

        AbstractPonyModel modelbase;
        if (armorSlot == EntityEquipmentSlot.LEGS) {
            modelbase = pony.getArmor().modelArmor;
        } else {
            modelbase = pony.getArmor().modelArmorChestplate;
        }
        modelbase = getArmorModel(entity, itemstack, armorSlot, modelbase);
        modelbase.setModelAttributes(this.pony.getModel());
        modelbase.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);

        Tuple<ResourceLocation, Boolean> armors = getArmorTexture(entity, itemstack, armorSlot, null);
        prepareToRender((ModelPonyArmor) modelbase, armorSlot, armors.getSecond());

        this.getRenderer().bindTexture(armors.getFirst());
        if (itemarmor.getArmorMaterial() == ArmorMaterial.LEATHER) {
            int color = itemarmor.getColor(itemstack);
            float r = (color >> 16 & 255) / 255.0F;
            float g = (color >> 8 & 255) / 255.0F;
            float b = (color & 255) / 255.0F;
            GlStateManager.color(r, g, b, 1);
            modelbase.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
            armors = getArmorTexture(entity, itemstack, armorSlot, "overlay");
            this.getRenderer().bindTexture(armors.getFirst());
        }
        GlStateManager.color(1, 1, 1, 1);
        modelbase.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);

        if (itemstack.isItemEnchanted()) {
            this.renderEnchantment(entity, modelbase, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
        }
    }
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:40,代码来源:LayerPonyArmor.java

示例11: getRepairStack

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
/** Get an armor material's repair stack */
public static ItemStack getRepairStack(ArmorMaterial mat) {
	if(matMap.containsKey(mat)) {
		return matMap.get(mat);
	} else {
		return null;
	}
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:9,代码来源:ArmorHelper.java

示例12: SetArmor

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public SetArmor(String type,ArmorMaterial material) {
	this.Type=type;
	this.Material=material;
	this.Helm=new ItemBasicArmor(material, 0, EntityEquipmentSlot.HEAD, type);
	this.Chest=new ItemBasicArmor(material, 1, EntityEquipmentSlot.CHEST, type);
	this.Legs=new ItemBasicArmor(material, 2, EntityEquipmentSlot.LEGS, type);
	this.Boots=new ItemBasicArmor(material, 3, EntityEquipmentSlot.FEET, type);
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:9,代码来源:SetArmor.java

示例13: addMaterial

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public static void addMaterial(String type,ToolMaterial toolMat,ArmorMaterial armorMat){
	Ingot.Metal.add(type);
	Dust.Metal.add(type);
	Nugget.Metal.add(type);
	Gear.Metal.add(type);
	Plate.Metal.add(type);
	Rod.Metal.add(type);
	if(toolMat!=null&&Config.IsToolsEnabled){
		Tools.add(new SetTools(type, toolMat));
	}
	if(armorMat!=null&&Config.IsArmorEnebled){
		Armor.add(new SetArmor(type, armorMat));
	}
	Types.add(type);
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:16,代码来源:ItemManager.java

示例14: addSecondary

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
public static void addSecondary(String type,ToolMaterial toolMat,ArmorMaterial armorMat,boolean shears){
	if(toolMat!=null&&Config.IsToolsEnabled){
		Tools.add(new SetTools(type, toolMat,shears));
	}
	if(armorMat!=null&&Config.IsArmorEnebled){
		Armor.add(new SetArmor(type, armorMat));
	}
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:9,代码来源:ItemManager.java

示例15: registerGlowingMaterials

import net.minecraft.item.ItemArmor.ArmorMaterial; //导入依赖的package包/类
private static void registerGlowingMaterials() {
  ArmorMaterial mimicArmor = ArmorMaterial.IRON;
  MaterialRegistry.glowingArmorMaterial = EnumHelper.addArmorMaterial(GLOWING, Const.MODRES + GLOWING,
      ironDurability, // affects DURABILITY  
      new int[] {
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.FEET),
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.LEGS),
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.CHEST),
          mimicArmor.getDamageReductionAmount(EntityEquipmentSlot.HEAD)
      },
      mimicArmor.getEnchantability() + 1,
      mimicArmor.getSoundEvent(),
      mimicArmor.getToughness() + 1);
  MaterialRegistry.glowingArmorMaterial.repairMaterial = new ItemStack(Blocks.GLOWSTONE);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:16,代码来源:MaterialRegistry.java


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