diff --git a/src/java/mmm/tech/tools/TTToolSet.java b/src/java/mmm/tech/tools/TTToolSet.java new file mode 100644 index 0000000..8f1835f --- /dev/null +++ b/src/java/mmm/tech/tools/TTToolSet.java @@ -0,0 +1,42 @@ +package mmm.tech.tools; + + +import mmm.utils.URegistry; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraftforge.common.util.EnumHelper; + + + +public class TTToolSet +{ + + public final ToolMaterial TOOL_MATERIAL; + + public final ItemSpade SHOVEL; + public final ItemAxe AXE; + public final ItemPickaxe PICKAXE; + + public final ItemSword SWORD; + + + public TTToolSet( final String name , final Item material , final int harvestLevel , final int maxUses , + final float efficiency , final float damage , final int enchantability , final float axeDamage , + final float axeSpeed ) + { + this.TOOL_MATERIAL = EnumHelper + .addToolMaterial( name.toUpperCase( ) , harvestLevel , maxUses , efficiency , damage , enchantability )// + .setRepairItem( new ItemStack( material ) ); + + URegistry.addItem( this.SHOVEL = new TTShovel( this.TOOL_MATERIAL ) ); + URegistry.addItem( this.AXE = new TTAxe( this.TOOL_MATERIAL , axeDamage , axeSpeed ) ); + URegistry.addItem( this.PICKAXE = new TTPickaxe( this.TOOL_MATERIAL ) ); + + URegistry.addItem( this.SWORD = new TTSword( this.TOOL_MATERIAL ) ); + } +} diff --git a/src/java/mmm/tech/tools/Tools.java b/src/java/mmm/tech/tools/Tools.java index 00fd66b..5cd556f 100644 --- a/src/java/mmm/tech/tools/Tools.java +++ b/src/java/mmm/tech/tools/Tools.java @@ -2,29 +2,15 @@ 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; + public static final TTToolSet 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 ) ); + COPPER = new TTToolSet( "copper" , Materials.COPPER.INGOT , 2 , 192 , 5.0f , 1.5f , 18 , 7 , -3 ); }