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); for axes 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, 161, 6, 1, 18); public static final Item.ToolMaterial TOOL_BRONZE = EnumHelper.addToolMaterial("BRONZE", 2, 208, 7, 1.5f, 15); /* 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", 9, new int[]{1, 4, 5, 1}, 20, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0); public static final ArmorMaterial ARMOR_BRONZE = EnumHelper.addArmorMaterial("BRONZE", KajetansMod.MODID + ":bronze", 13, new int[]{2, 5, 6, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_CHAIN, 0); // nuggets and ingots public static ItemBase copperIngot; public static ItemBase copperNugget; public static ItemBase tinIngot; public static ItemBase tinNugget; public static ItemBase bronzeIngot; public static ItemBase bronzeNugget; // tools and swords public static ItemSword copperSword; public static ItemSpade copperShovel; public static ItemPickaxe copperPickaxe; public static ItemAxe copperAxe; public static ItemHoe copperHoe; public static ItemSword bronzeSword; public static ItemSpade bronzeShovel; public static ItemPickaxe bronzePickaxe; public static ItemAxe bronzeAxe; public static ItemHoe bronzeHoe; // armor public static ItemArmor copperHelmet; public static ItemArmor copperChestplate; public static ItemArmor copperLeggings; public static ItemArmor copperBoots; public static ItemArmor bronzeHelmet; public static ItemArmor bronzeChestplate; public static ItemArmor bronzeLeggings; public static ItemArmor bronzeBoots; // wands public static ItemWand woodenWand; // coins public static ItemBase copperCoin; public static ItemBase silverCoin; public static ItemBase goldCoin; // misc public static ItemScroll scroll; public static ItemBed realHayBed; public static void init() { // nuggets and ingots copperIngot = register(new ItemBase("copper_ingot", "ingotCopper").setCreativeTab(CreativeTabs.MATERIALS)); copperNugget = register(new ItemBase("copper_nugget", "copperNugget").setCreativeTab(CreativeTabs.MATERIALS)); tinIngot = register(new ItemBase("tin_ingot", "ingotTin").setCreativeTab(CreativeTabs.MATERIALS)); tinNugget = register(new ItemBase("tin_nugget", "tinNugget").setCreativeTab(CreativeTabs.MATERIALS)); bronzeIngot = register(new ItemBase("bronze_ingot", "ingotBronze").setCreativeTab(CreativeTabs.MATERIALS)); bronzeNugget = register(new ItemBase("bronze_nugget", "bronzeNugget").setCreativeTab(CreativeTabs.MATERIALS)); // repair items TOOL_COPPER.setRepairItem(new ItemStack(copperIngot)); ARMOR_COPPER.setRepairItem(new ItemStack(copperIngot)); TOOL_BRONZE.setRepairItem(new ItemStack(bronzeIngot)); ARMOR_BRONZE.setRepairItem(new ItemStack(bronzeIngot)); // tools and swords 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")); bronzeSword = register(new ItemSword(TOOL_BRONZE, "bronze_sword", "swordBronze")); bronzeShovel = register(new ItemSpade(TOOL_BRONZE, "bronze_shovel", "shovelBronze")); bronzePickaxe = register(new ItemPickaxe(TOOL_BRONZE, "bronze_pickaxe", "pickaxeBronze")); bronzeAxe = register(new ItemAxe(TOOL_BRONZE, 8, -3.0f, "bronze_axe", "hatchetBronze")); bronzeHoe = register(new ItemHoe(TOOL_BRONZE, "bronze_hoe", "hoeBronze")); // armor 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")); bronzeHelmet = register(new ItemArmor(ARMOR_BRONZE, EntityEquipmentSlot.HEAD, "bronze_helmet", "helmetBronze")); bronzeChestplate = register(new ItemArmor(ARMOR_BRONZE, EntityEquipmentSlot.CHEST, "bronze_chestplate", "chestplateBronze")); bronzeLeggings = register(new ItemArmor(ARMOR_BRONZE, EntityEquipmentSlot.LEGS, "bronze_leggings", "leggingsBronze")); bronzeBoots = register(new ItemArmor(ARMOR_BRONZE, EntityEquipmentSlot.FEET, "bronze_boots", "bootsBronze")); // wands woodenWand = register(new ItemWand("wood_wand", "wandWood", Item.ToolMaterial.WOOD, 1)); // coins copperCoin = register(new ItemBase("coin_copper", "coinCopper").setCreativeTab(CreativeTabs.MISC)); silverCoin = register(new ItemBase("coin_silver", "coinSilver").setCreativeTab(CreativeTabs.MISC)); goldCoin = register(new ItemBase("coin_gold", "coinGold").setCreativeTab(CreativeTabs.MISC)); // misc scroll = register((ItemScroll) new ItemScroll("scroll", "scroll").setCreativeTab(CreativeTabs.MISC)); realHayBed = register(new ItemBed("real_hay_bed", "realHayBed")); } private static T register(T item) { GameRegistry.register(item); if(item instanceof ItemModelProvider) { ((ItemModelProvider) item).registerItemModel(item); } return item; } }