diff --git a/TODO.txt b/TODO.txt index 2c8870d..f5858c2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -32,8 +32,6 @@ food No Extra recipes Pizza Various mashes ------------------------------------------------------------------------------------------------------- -tech.tools No Copper armor -------------------------------------------------------------------------------------------------------- ??? ??? Sub-blocks ??? Yes Improved pistons ??? ??? Insulated redstone wires diff --git a/src/java/mmm/tech/tools/TTArmor.java b/src/java/mmm/tech/tools/TTArmor.java new file mode 100644 index 0000000..5c7282a --- /dev/null +++ b/src/java/mmm/tech/tools/TTArmor.java @@ -0,0 +1,68 @@ +package mmm.tech.tools; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class TTArmor + extends ItemArmor + implements I_URecipeRegistrar +{ + + public TTArmor( final ArmorMaterial materialIn , final EntityEquipmentSlot equipmentSlotIn ) + { + super( materialIn , materialIn.ordinal( ) , equipmentSlotIn ); + URegistry.setIdentifiers( this , "tech" , "tools" , "armor" , materialIn.toString( ).toLowerCase( ) , + equipmentSlotIn.getName( ) ); + } + + + @Override + public void registerRecipes( ) + { + String l0 , l1 , l2; + + switch ( this.getEquipmentSlot( ) ) { + + case CHEST: + l0 = "I I"; + l1 = "III"; + l2 = "III"; + break; + case FEET: + l0 = "I I"; + l1 = "I I"; + l2 = null; + break; + case HEAD: + l0 = "III"; + l1 = "I I"; + l2 = null; + break; + case LEGS: + l0 = "III"; + l1 = "I I"; + l2 = "I I"; + break; + + default: + throw new IllegalArgumentException( "unsupported armor slot '" + this.getEquipmentSlot( ) + "'" ); + + } + + final ItemStack self = new ItemStack( this ); + final ItemStack ingredient = new ItemStack( this.getArmorMaterial( ).getRepairItem( ) ); + if ( l2 == null ) { + GameRegistry.addShapedRecipe( self , l0 , l1 , 'I' , ingredient ); + } else { + GameRegistry.addShapedRecipe( self , l0 , l1 , l2 , 'I' , ingredient ); + } + } + +} diff --git a/src/java/mmm/tech/tools/TTArmorSet.java b/src/java/mmm/tech/tools/TTArmorSet.java new file mode 100644 index 0000000..b5a49e7 --- /dev/null +++ b/src/java/mmm/tech/tools/TTArmorSet.java @@ -0,0 +1,36 @@ +package mmm.tech.tools; + + +import mmm.utils.URegistry; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.util.SoundEvent; +import net.minecraftforge.common.util.EnumHelper; + + + +public class TTArmorSet +{ + + public final ArmorMaterial ARMOR_MATERIAL; + + public final TTArmor HELMET; + public final TTArmor CHESTPLATE; + public final TTArmor LEGGINGS; + public final TTArmor BOOTS; + + + public TTArmorSet( final String name , final Item material , final int durability , final int[] reductionAmounts , + final int enchantability , final SoundEvent soundOnEquip , final float toughness ) + { + this.ARMOR_MATERIAL = EnumHelper.addArmorMaterial( name.toUpperCase( ) , "mmm:" + name , durability , + reductionAmounts , enchantability , soundOnEquip , toughness ); + this.ARMOR_MATERIAL.customCraftingMaterial = material; + + URegistry.addItem( this.HELMET = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.HEAD ) ); + URegistry.addItem( this.CHESTPLATE = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.CHEST ) ); + URegistry.addItem( this.LEGGINGS = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.LEGS ) ); + URegistry.addItem( this.BOOTS = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.FEET ) ); + } +} diff --git a/src/java/mmm/tech/tools/Tools.java b/src/java/mmm/tech/tools/Tools.java index 5cd556f..7f7bd96 100644 --- a/src/java/mmm/tech/tools/Tools.java +++ b/src/java/mmm/tech/tools/Tools.java @@ -2,15 +2,20 @@ package mmm.tech.tools; import mmm.materials.Materials; +import net.minecraft.init.SoundEvents; public class Tools { - public static final TTToolSet COPPER; + public static final TTToolSet COPPER_TOOLS; + public static final TTArmorSet COPPER_ARMOR; static { - COPPER = new TTToolSet( "copper" , Materials.COPPER.INGOT , 2 , 192 , 5.0f , 1.5f , 18 , 7 , -3 ); + COPPER_TOOLS = new TTToolSet( "copper" , Materials.COPPER.INGOT , 2 , 192 , 5.0f , 1.5f , 18 , 7 , -3 ); + COPPER_ARMOR = new TTArmorSet( "copper" , Materials.COPPER.INGOT , 10 , new int[] { + 1 , 3 , 4 , 1 + } , 20 , SoundEvents.ITEM_ARMOR_EQUIP_GENERIC , 0 ); } diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 0ceb438..ad4518c 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -36,3 +36,8 @@ item.mmm.tech.tools.shovel.copper.name=Copper Shovel item.mmm.tech.tools.axe.copper.name=Copper Axe item.mmm.tech.tools.pickaxe.copper.name=Copper Pickaxe item.mmm.tech.tools.sword.copper.name=Copper Sword + +item.mmm.tech.tools.armor.copper.feet.name=Copper Boots +item.mmm.tech.tools.armor.copper.legs.name=Copper Leggings +item.mmm.tech.tools.armor.copper.chest.name=Copper Chestplate +item.mmm.tech.tools.armor.copper.head.name=Copper Helmet \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/armor/copper/chest.json b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/chest.json new file mode 100644 index 0000000..7655032 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/chest.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/armor/copper/chest" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/armor/copper/feet.json b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/feet.json new file mode 100644 index 0000000..395d577 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/feet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/armor/copper/feet" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/armor/copper/head.json b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/head.json new file mode 100644 index 0000000..12b3a26 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/head.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/armor/copper/head" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/armor/copper/legs.json b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/legs.json new file mode 100644 index 0000000..e023117 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/armor/copper/legs.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/armor/copper/legs" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/chest.png b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/chest.png new file mode 100644 index 0000000..fd99d23 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/chest.png differ diff --git a/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/feet.png b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/feet.png new file mode 100644 index 0000000..6b5c068 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/feet.png differ diff --git a/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/head.png b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/head.png new file mode 100644 index 0000000..c28fc85 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/head.png differ diff --git a/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/legs.png b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/legs.png new file mode 100644 index 0000000..84648eb Binary files /dev/null and b/src/resources/assets/mmm/textures/items/tech/tools/armor/copper/legs.png differ diff --git a/src/resources/assets/mmm/textures/models/armor/copper_layer_1.png b/src/resources/assets/mmm/textures/models/armor/copper_layer_1.png new file mode 100644 index 0000000..4d8ec12 Binary files /dev/null and b/src/resources/assets/mmm/textures/models/armor/copper_layer_1.png differ diff --git a/src/resources/assets/mmm/textures/models/armor/copper_layer_2.png b/src/resources/assets/mmm/textures/models/armor/copper_layer_2.png new file mode 100644 index 0000000..96c332d Binary files /dev/null and b/src/resources/assets/mmm/textures/models/armor/copper_layer_2.png differ