From ae8f8ff176ca7a2fa7b1732896ac82ee7b8141f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Fri, 17 Jun 2016 09:30:22 +0200 Subject: [PATCH] Copper armor --- TODO.txt | 2 - src/java/mmm/tech/tools/TTArmor.java | 68 ++++++++++++++++++ src/java/mmm/tech/tools/TTArmorSet.java | 36 ++++++++++ src/java/mmm/tech/tools/Tools.java | 9 ++- src/resources/assets/mmm/lang/en_US.lang | 5 ++ .../item/tech/tools/armor/copper/chest.json | 6 ++ .../item/tech/tools/armor/copper/feet.json | 6 ++ .../item/tech/tools/armor/copper/head.json | 6 ++ .../item/tech/tools/armor/copper/legs.json | 6 ++ .../items/tech/tools/armor/copper/chest.png | Bin 0 -> 178 bytes .../items/tech/tools/armor/copper/feet.png | Bin 0 -> 156 bytes .../items/tech/tools/armor/copper/head.png | Bin 0 -> 144 bytes .../items/tech/tools/armor/copper/legs.png | Bin 0 -> 139 bytes .../textures/models/armor/copper_layer_1.png | Bin 0 -> 938 bytes .../textures/models/armor/copper_layer_2.png | Bin 0 -> 564 bytes 15 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 src/java/mmm/tech/tools/TTArmor.java create mode 100644 src/java/mmm/tech/tools/TTArmorSet.java create mode 100644 src/resources/assets/mmm/models/item/tech/tools/armor/copper/chest.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/armor/copper/feet.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/armor/copper/head.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/armor/copper/legs.json create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/armor/copper/chest.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/armor/copper/feet.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/armor/copper/head.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/armor/copper/legs.png create mode 100644 src/resources/assets/mmm/textures/models/armor/copper_layer_1.png create mode 100644 src/resources/assets/mmm/textures/models/armor/copper_layer_2.png 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 0000000000000000000000000000000000000000..fd99d23b3340cb6cf5f84797ccad6a2dfbebecf1 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`m7Xq+Ar_~T6C_Fwcy#@@=MdKJ zTll~y_sjpO57jif5+5n>Bzb?_^#Aw;o?r%JhDbrhN*>k|+Y%=q&SLNoQ2CkgIL6>u znu3pU8{>&}3f{&X4J?W46izeLBsN}tebP0l+XkKE1Evm literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..6b5c068bfaf5f4810e92514c763c839b507c6861 GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`$(}BbAr_~T6C~;mcy#@@=XorA zc;!!@+%Ny9K2-a^wBqJ}VWHz$2bz0}H%c}5&N0)IuwYL3cO;#GC;155CZ-8#IcyC_ zCR|;xgJl`R>@*36&W9n)Mhq$phj$#}h~&L@KqiWTA$;B(j;NKY*+AbP0l+XkK7*sC| literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..84648ebf214f2140e25e8f840778426fa3538e7f GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`L7py-Ar_~T6C_Fwcy#@@xAO`3 zJo8q@oQl*PC+juizWrz6t=LegClQ>&;9+Q_c9LO++JqzlwbKkKtvimm^Ddamcp}il mLuNJOh8^za46`jl85q81T~>EyJfs0Mox#)9&t;ucLK6Takt~V; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4d8ec12621b670024cf5601eaa3c633b8c9111dd GIT binary patch literal 938 zcmV;b16BNqP)8k0juJfP&tQic(TpOz=n=dzyHs9`@Y1UVcHyd|PHQyhcYglIt=KVt0zaKx; z@$1!cv-RS7^Yi6WfUz(DY`E*>@02*f~{Euf>n$Jsz=O2LeJ145(ThFh? z0090j1OpKE_nX^6eObUgYYSrn+Pw@Agv}?H<{tn&y&;c*-A6cV@4wzUHv0e&(XDdFia}AduS?E_>o8g zJEkJc#erIf#sL)$?IU!iDT1KU%${sMfQew4A*|)l86Xsv@r~XA2;0=bEgxydJ(~g8 zi&5EEFa*VXLNno+`Hvz6gzP_tk1qym79x+x%+M)Lh4cG=9q@v#*`9mPOxv@VgJ4db zIY|?lz5&2d6OB+zC)Fs<3$zWDeFH#P#+h=SPBKYbVv*X836ougZF7{Vh$66K`0#x7 z?$!yr0qMaRXwkZ3x2OoNjb*FHjFLGDL%;>FcOz9-~Wr$m|C<^Uk?oFs%XX$DMQ zgRM|HootiX6O{UN?a+?7POEBg))|0MYJd--)#}xYMr~%u5)W$KuQ!jJpao=9AotI? zf*u?I{IAn!*Qm2hFNZM;4e4lGT*|^254#sdS-10}K>InQ0HWO&@G!MbOXeJx8EDi7 zr{LrsAHKov&VCftGasaj)O*Lq@KM7JAttrIqfK7SL2a3I%zC;14`yHSkedv^pa1{> M07*qoM6N<$f}HNf>;M1& literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..96c332dca259a1fdab58d452cfd4af6d615bd0f1 GIT binary patch literal 564 zcmV-40?Yl0P)YOa3?)h>m9{~q5>HF~^ecaR% zWR#A8&go+MyxVrgE*$|L{sx>+qM`7BpEpO-%hs5KCFh-h<9YX6dsChUt=&oA)2xrX zYAH?lN_DPq397y3)(Syp@8r_BTf?)jy_hA0ucXW?|)ELbG zei6GEmsGpcv=3+d=QKKNZorqSUJx~$We?wb7lEMP^MB8%DCc63B0AI- z^ei65yGqMKZUxCqQ>Wn+l_wBQ4LZ%7NMlc zzbC-kWafo6NNKPFbas%^es8Om^VyoC2-5yRq`(h#Vf*RB#DK>D0000