From 284e7479f383c07ebe5fdd18e926b3324bc6632c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 16 Jun 2016 16:22:52 +0200 Subject: [PATCH] Copper tools --- TODO.txt | 3 +- src/java/mmm/proxy/PCommon.java | 2 + src/java/mmm/tech/tools/TTAxe.java | 36 ++++++++++++++++ src/java/mmm/tech/tools/TTPickaxe.java | 36 ++++++++++++++++ src/java/mmm/tech/tools/TTShovel.java | 35 ++++++++++++++++ src/java/mmm/tech/tools/TTSword.java | 39 ++++++++++++++++++ src/java/mmm/tech/tools/Tools.java | 36 ++++++++++++++++ src/resources/assets/mmm/lang/en_US.lang | 5 +++ .../models/item/tech/tools/axe/copper.json | 6 +++ .../item/tech/tools/pickaxe/copper.json | 6 +++ .../models/item/tech/tools/shovel/copper.json | 6 +++ .../models/item/tech/tools/sword/copper.json | 6 +++ .../textures/items/tech/tools/axe/copper.png | Bin 0 -> 171 bytes .../items/tech/tools/pickaxe/copper.png | Bin 0 -> 181 bytes .../items/tech/tools/shovel/copper.png | Bin 0 -> 154 bytes .../items/tech/tools/sword/copper.png | Bin 0 -> 182 bytes 16 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 src/java/mmm/tech/tools/TTAxe.java create mode 100644 src/java/mmm/tech/tools/TTPickaxe.java create mode 100644 src/java/mmm/tech/tools/TTShovel.java create mode 100644 src/java/mmm/tech/tools/TTSword.java create mode 100644 src/java/mmm/tech/tools/Tools.java create mode 100644 src/resources/assets/mmm/models/item/tech/tools/axe/copper.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/pickaxe/copper.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/shovel/copper.json create mode 100644 src/resources/assets/mmm/models/item/tech/tools/sword/copper.json create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/axe/copper.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/pickaxe/copper.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/shovel/copper.png create mode 100644 src/resources/assets/mmm/textures/items/tech/tools/sword/copper.png diff --git a/TODO.txt b/TODO.txt index 933e847..2c8870d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -32,8 +32,7 @@ food No Extra recipes Pizza Various mashes ------------------------------------------------------------------------------------------------------- -tech.tools ??? Copper tools -tech.tools ??? Copper armor +tech.tools No Copper armor ------------------------------------------------------------------------------------------------------- ??? ??? Sub-blocks ??? Yes Improved pistons diff --git a/src/java/mmm/proxy/PCommon.java b/src/java/mmm/proxy/PCommon.java index 284f8cd..abad892 100644 --- a/src/java/mmm/proxy/PCommon.java +++ b/src/java/mmm/proxy/PCommon.java @@ -4,6 +4,7 @@ package mmm.proxy; import mmm.Mmm; import mmm.deco.DecorativeBlocks; import mmm.materials.Materials; +import mmm.tech.tools.Tools; import mmm.utils.UAccessors; import mmm.utils.URegistry; import mmm.utils.USeat; @@ -22,6 +23,7 @@ public abstract class PCommon DecorativeBlocks.preInit( ); Materials.preInit( ); + Tools.preInit( ); URegistry.registerRecipes( ); } diff --git a/src/java/mmm/tech/tools/TTAxe.java b/src/java/mmm/tech/tools/TTAxe.java new file mode 100644 index 0000000..c48ccea --- /dev/null +++ b/src/java/mmm/tech/tools/TTAxe.java @@ -0,0 +1,36 @@ +package mmm.tech.tools; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.init.Items; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class TTAxe + extends ItemAxe + implements I_URecipeRegistrar +{ + + public TTAxe( final ToolMaterial material , float damage , float attackSpeed ) + { + super( material , damage , attackSpeed ); + URegistry.setIdentifiers( this , "tech" , "tools" , "axe" , material.toString( ).toLowerCase( ) ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapedRecipe( new ItemStack( this ) , // + "II" , // + "IS" , // + " S" , // + 'I' , this.getToolMaterial( ).getRepairItemStack( ) , // + 'S' , new ItemStack( Items.STICK ) ); + } + +} diff --git a/src/java/mmm/tech/tools/TTPickaxe.java b/src/java/mmm/tech/tools/TTPickaxe.java new file mode 100644 index 0000000..1049f35 --- /dev/null +++ b/src/java/mmm/tech/tools/TTPickaxe.java @@ -0,0 +1,36 @@ +package mmm.tech.tools; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class TTPickaxe + extends ItemPickaxe + implements I_URecipeRegistrar +{ + + public TTPickaxe( final ToolMaterial material ) + { + super( material ); + URegistry.setIdentifiers( this , "tech" , "tools" , "pickaxe" , material.toString( ).toLowerCase( ) ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapedRecipe( new ItemStack( this ) , // + "III" , // + " S " , // + " S " , // + 'I' , this.getToolMaterial( ).getRepairItemStack( ) , // + 'S' , new ItemStack( Items.STICK ) ); + } + +} diff --git a/src/java/mmm/tech/tools/TTShovel.java b/src/java/mmm/tech/tools/TTShovel.java new file mode 100644 index 0000000..f2244b7 --- /dev/null +++ b/src/java/mmm/tech/tools/TTShovel.java @@ -0,0 +1,35 @@ +package mmm.tech.tools; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.init.Items; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class TTShovel + extends ItemSpade + implements I_URecipeRegistrar +{ + public TTShovel( final ToolMaterial material ) + { + super( material ); + URegistry.setIdentifiers( this , "tech" , "tools" , "shovel" , material.toString( ).toLowerCase( ) ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapedRecipe( new ItemStack( this ) , // + "I" , // + "S" , // + "S" , // + 'I' , this.getToolMaterial( ).getRepairItemStack( ) , // + 'S' , new ItemStack( Items.STICK ) ); + } + +} diff --git a/src/java/mmm/tech/tools/TTSword.java b/src/java/mmm/tech/tools/TTSword.java new file mode 100644 index 0000000..af3cb29 --- /dev/null +++ b/src/java/mmm/tech/tools/TTSword.java @@ -0,0 +1,39 @@ +package mmm.tech.tools; + + +import mmm.utils.I_URecipeRegistrar; +import mmm.utils.URegistry; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class TTSword + extends ItemSword + implements I_URecipeRegistrar +{ + protected final ToolMaterial material; + + + public TTSword( final ToolMaterial material ) + { + super( material ); + this.material = material; + URegistry.setIdentifiers( this , "tech" , "tools" , "sword" , material.toString( ).toLowerCase( ) ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapedRecipe( new ItemStack( this ) , // + "I" , // + "I" , // + "S" , // + 'I' , this.material.getRepairItemStack( ) , // + 'S' , new ItemStack( Items.STICK ) ); + } + +} diff --git a/src/java/mmm/tech/tools/Tools.java b/src/java/mmm/tech/tools/Tools.java new file mode 100644 index 0000000..00fd66b --- /dev/null +++ b/src/java/mmm/tech/tools/Tools.java @@ -0,0 +1,36 @@ +package mmm.tech.tools; + + +import mmm.materials.Materials; +import mmm.utils.URegistry; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.EnumHelper; + + + +public class Tools +{ + public static final ToolMaterial TM_COPPER; + public static final TTSword SWORD_COPPER; + public static final TTShovel SPADE_COPPER; + public static final TTAxe AXE_COPPER; + public static final TTPickaxe PICKAXE_COPPER; + + static { + TM_COPPER = EnumHelper.addToolMaterial( "COPPER" , 2 , 192 , 5.0f , 1.5f , 18 )// + .setRepairItem( new ItemStack( Materials.COPPER.INGOT ) ); + + URegistry.addItem( SWORD_COPPER = new TTSword( Tools.TM_COPPER ) ); + URegistry.addItem( SPADE_COPPER = new TTShovel( Tools.TM_COPPER ) ); + URegistry.addItem( AXE_COPPER = new TTAxe( Tools.TM_COPPER , 7f , -3f ) ); + URegistry.addItem( PICKAXE_COPPER = new TTPickaxe( Tools.TM_COPPER ) ); + } + + + public static void preInit( ) + { + // EMPTY + } + +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 5661746..bdc3c3f 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -32,3 +32,8 @@ tile.mmm.materials.ore.malachite.name=Malachite Ore item.mmm.materials.stone.cuprite.name=Cuprite tile.mmm.materials.ore.cuprite.name=Cuprite Ore + +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 diff --git a/src/resources/assets/mmm/models/item/tech/tools/axe/copper.json b/src/resources/assets/mmm/models/item/tech/tools/axe/copper.json new file mode 100644 index 0000000..21f32a4 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/axe/copper.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/axe/copper" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/pickaxe/copper.json b/src/resources/assets/mmm/models/item/tech/tools/pickaxe/copper.json new file mode 100644 index 0000000..1fa0064 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/pickaxe/copper.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/pickaxe/copper" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/shovel/copper.json b/src/resources/assets/mmm/models/item/tech/tools/shovel/copper.json new file mode 100644 index 0000000..8226775 --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/shovel/copper.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/shovel/copper" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/tech/tools/sword/copper.json b/src/resources/assets/mmm/models/item/tech/tools/sword/copper.json new file mode 100644 index 0000000..862a02e --- /dev/null +++ b/src/resources/assets/mmm/models/item/tech/tools/sword/copper.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/tech/tools/sword/copper" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/tech/tools/axe/copper.png b/src/resources/assets/mmm/textures/items/tech/tools/axe/copper.png new file mode 100644 index 0000000000000000000000000000000000000000..c05a267234fa2c0c2c81173c7a44372f855862aa GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`MV>B>Ar_~T6Be*rOnd)NzUAb# zn)L+y(; VuOgQ1;XvCNJYD@<);T3K0RU`zLL>kH literal 0 HcmV?d00001 diff --git a/src/resources/assets/mmm/textures/items/tech/tools/pickaxe/copper.png b/src/resources/assets/mmm/textures/items/tech/tools/pickaxe/copper.png new file mode 100644 index 0000000000000000000000000000000000000000..1ed54968d361a22cc4f186fd0dfc8ae15af84ac4 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`HJ&bxAr_~T6C}1gh*0tuQ-LPwAw! z!C8g$<{Y3a;oXh)}FOW^)c8`pii)2Hd@g_!=y$xs6zGxiFWYC*^kyr6%+9c=M gDGuAtPGMpwx;9m%A#}repgR~mUHx3vIVCg!0B6@pLI3~& literal 0 HcmV?d00001 diff --git a/src/resources/assets/mmm/textures/items/tech/tools/shovel/copper.png b/src/resources/assets/mmm/textures/items/tech/tools/shovel/copper.png new file mode 100644 index 0000000000000000000000000000000000000000..8f9fa8ca193df8d81362d27ee4f3a8c06c9982cd GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`iJmTwAr_~T6C{EjM6CN=FQMlB z`R`Wa13!L!k-Egwn7Pk#KkpjJBWkx8O3o_GQek#DaM@>y(b>5#U;Q_IvP1JS&u2c* zS;l{!JecLl^ulcNnwdJY9i=q3&CEG_qAehW!IFWYdu3TpXp^-*&@u*3S3j3^P65*7FvljzWsn+a literal 0 HcmV?d00001