123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package me.km.items;
- import me.km.KajetansMod;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemArmor.ArmorMaterial;
- import net.minecraft.item.ItemStack;
- import net.minecraftforge.common.util.EnumHelper;
- import net.minecraftforge.fml.common.registry.GameRegistry;
- public class ModItems
- {
- /*
- harvestLevel, maxUses, efficiency, damageVsEntity, enchantability
- WOOD(0, 59, 2.0F, 0.0F, 15),
- STONE(1, 131, 4.0F, 1.0F, 5),
- IRON(2, 250, 6.0F, 2.0F, 14),
- DIAMOND(3, 1561, 8.0F, 3.0F, 10),
- GOLD(0, 32, 12.0F, 0.0F, 22);
- ATTACK_DAMAGES {6.0F, 8.0F, 8.0F, 8.0F, 6.0F}
- ATTACK_SPEEDS { -3.2F, -3.2F, -3.1F, -3.0F, -3.0F}
- */
- public static final Item.ToolMaterial TOOL_COPPER =
- EnumHelper.addToolMaterial("COPPER", 1, 168, 8, 1, 18);
-
- /*
- String nameIn, int maxDamageFactorIn, int[] damageReductionAmountArrayIn,
- int enchantabilityIn, SoundEvent soundEventIn, float toughnessIn
- LEATHER("leather", 5, new int[]{1, 2, 3, 1}, 15, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0F),
- CHAIN("chainmail", 15, new int[]{1, 4, 5, 2}, 12, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0.0F),
- IRON("iron", 15, new int[]{2, 5, 6, 2}, 9, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F),
- GOLD("gold", 7, new int[]{1, 3, 5, 2}, 25, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0F),
- DIAMOND("diamond", 33, new int[]{3, 6, 8, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 2.0F);
- */
- public static final ArmorMaterial ARMOR_COPPER =
- EnumHelper.addArmorMaterial("COPPER", KajetansMod.MODID + ":copper", 10,
- new int[]{1, 4, 5, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0);
-
- public static ItemBase copperIngot;
- public static ItemBase copperNugget;
-
- public static ItemSword copperSword;
- public static ItemSpade copperShovel;
- public static ItemPickaxe copperPickaxe;
- public static ItemAxe copperAxe;
- public static ItemHoe copperHoe;
-
- public static ItemArmor copperHelmet;
- public static ItemArmor copperChestplate;
- public static ItemArmor copperLeggings;
- public static ItemArmor copperBoots;
-
- public static ItemWand woodenWand;
-
- public static ItemScroll scroll;
-
- public static void init()
- {
- copperIngot = register(new ItemBase("copper_ingot", "ingotCopper").setCreativeTab(CreativeTabs.MATERIALS));
- copperNugget = register(new ItemBase("copper_nugget", "copperNugget").setCreativeTab(CreativeTabs.MATERIALS));
-
- copperSword = register(new ItemSword(TOOL_COPPER, "copper_sword", "swordCopper"));
- copperShovel = register(new ItemSpade(TOOL_COPPER, "copper_shovel", "shovelCopper"));
- copperPickaxe = register(new ItemPickaxe(TOOL_COPPER, "copper_pickaxe", "pickaxeCopper"));
- copperAxe = register(new ItemAxe(TOOL_COPPER, 7, -3.1f, "copper_axe", "hatchetCopper"));
- copperHoe = register(new ItemHoe(TOOL_COPPER, "copper_hoe", "hoeCopper"));
-
- copperHelmet = register(new ItemArmor(ARMOR_COPPER, EntityEquipmentSlot.HEAD, "copper_helmet", "helmetCopper"));
- copperChestplate = register(new ItemArmor(ARMOR_COPPER, EntityEquipmentSlot.CHEST, "copper_chestplate", "chestplateCopper"));
- copperLeggings = register(new ItemArmor(ARMOR_COPPER, EntityEquipmentSlot.LEGS, "copper_leggings", "leggingsCopper"));
- copperBoots = register(new ItemArmor(ARMOR_COPPER, EntityEquipmentSlot.FEET, "copper_boots", "bootsCopper"));
-
- woodenWand = register(new ItemWand("wood_wand", "wandWood", Item.ToolMaterial.WOOD, 1));
-
- scroll = register((ItemScroll) new ItemScroll("scroll", "scroll").setCreativeTab(CreativeTabs.MISC));
- }
-
- public static void lateInit()
- {
- TOOL_COPPER.setRepairItem(new ItemStack(copperIngot));
- ARMOR_COPPER.setRepairItem(new ItemStack(copperIngot));
- }
-
- private static <T extends Item> T register(T item)
- {
- GameRegistry.register(item);
- if(item instanceof ItemModelProvider)
- {
- ((ItemModelProvider) item).registerItemModel(item);
- }
- return item;
- }
- }
|