當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。