Advertisement
Guest User

Tools+ Main File v0.0.1

a guest
Nov 24th, 2013
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.89 KB | None | 0 0
  1. package skysound.newtools;
  2.  
  3. import skysound.wings.Wings;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.block.BlockOreStorage;
  6. import net.minecraft.block.StepSound;
  7. import net.minecraft.creativetab.CreativeTabs;
  8. import net.minecraft.item.EnumToolMaterial;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemAxe;
  11. import net.minecraft.item.ItemFood;
  12. import net.minecraft.item.ItemHoe;
  13. import net.minecraft.item.ItemPickaxe;
  14. import net.minecraft.item.ItemSpade;
  15. import net.minecraft.item.ItemStack;
  16. import net.minecraft.item.ItemSword;
  17. import net.minecraftforge.common.EnumHelper;
  18. import cpw.mods.fml.common.Mod;
  19. import cpw.mods.fml.common.Mod.EventHandler;
  20. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  21. import cpw.mods.fml.common.network.NetworkMod;
  22. import cpw.mods.fml.common.registry.GameRegistry;
  23. import cpw.mods.fml.common.registry.LanguageRegistry;
  24.  
  25. //Define basic information for the mod.
  26.  
  27. @Mod(modid = "Skysound_Tools", name = "Tools+", version = "v0.0.1")
  28.  
  29. //Define client and server-side requirements
  30.  
  31. @NetworkMod(clientSideRequired = true, serverSideRequired = false)
  32.  
  33. public class ToolsMain {
  34.    
  35.     //Creative Tab
  36.    
  37.     public static CreativeTabs tabNewTools = new CreativeTabs("tabNewTools") {
  38.         public ItemStack getIconItemStack() {
  39.                 return new ItemStack(skysound.newtools.ToolsMain.greyGoldBlock, 1, 0);
  40.         }
  41.     };
  42.    
  43.     //Define Sounds
  44.    
  45.     public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
  46.    
  47.     //Defining the material
  48.    
  49.     public static EnumToolMaterial GreyGold = EnumHelper.addToolMaterial("GreyGold", 3, 180, 8.0f, 2.0f, 18);
  50.     public static EnumToolMaterial RoseGold = EnumHelper.addToolMaterial("RoseGold", 3, 80, 12.0f, 1.0f, 18);
  51.    
  52.     //Define tools & tools settings
  53.    
  54.         //Grey Gold
  55.     public static Item greyGoldSword = (new ItemSword(1000, GreyGold)).setUnlocalizedName("tools:greyGoldSword").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldSword");
  56.     public static Item greyGoldPickaxe = (new ItemPickaxe(1001, GreyGold)).setUnlocalizedName("tools:greyGoldPickaxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldPickaxe");
  57.     public static Item greyGoldAxe = (new ItemAxe(1002, GreyGold)).setUnlocalizedName("tools:greyGoldAxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldAxe");
  58.     public static Item greyGoldShovel = (new ItemSpade(1003, GreyGold)).setUnlocalizedName("tools:greyGoldShovel").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldShovel");
  59.     public static Item greyGoldHoe = (new ItemHoe(1004, GreyGold)).setUnlocalizedName("tools:greyGoldHoe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldHoe");
  60.    
  61.         //Rose Gold
  62.     public static Item roseGoldSword = (new ItemSword(1008, RoseGold)).setUnlocalizedName("tools:roseGoldSword").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldSword");
  63.     public static Item roseGoldPickaxe = (new ItemPickaxe(1009, RoseGold)).setUnlocalizedName("tools:roseGoldPickaxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldPickaxe");
  64.     public static Item roseGoldAxe = (new ItemAxe(1010, RoseGold)).setUnlocalizedName("tools:roseGoldAxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldAxe");
  65.     public static Item roseGoldShovel = (new ItemSpade(1011, RoseGold)).setUnlocalizedName("tools:roseGoldShovel").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldShovel");
  66.     public static Item roseGoldHoe = (new ItemHoe(1012, RoseGold)).setUnlocalizedName("tools:roseGoldHoe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldHoe");
  67.    
  68.     //Define Items
  69.    
  70.     public static Item greyGoldIngot = (new Item(1005)).setUnlocalizedName("greyGoldIngot").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldIngot");
  71.     public static Item muttonRaw = (new ItemFood(1006, 3, 0.3F, true)).setUnlocalizedName("muttonRaw").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:muttonRaw");
  72.     public static Item muttonCooked = (new ItemFood(1007, 8, 0.8F, true)).setUnlocalizedName("muttonCooked").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:muttonCooked");
  73.     public static Item roseGoldIngot = (new Item(1013)).setUnlocalizedName("roseGoldIngot").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldIngot");
  74.    
  75.     //Define blocks
  76.    
  77.     public static Block greyGoldBlock = (new BlockOreStorage(1008)).setHardness(4.0f).setResistance(10.0f).setStepSound(soundMetalFootstep).setUnlocalizedName("greyGoldBlock").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldBlock");
  78.     public static Block roseGoldBlock = (new BlockOreStorage(10014)).setHardness(4.0f).setResistance(10.0f).setStepSound(soundMetalFootstep).setUnlocalizedName("roseGoldBlock").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldBlock");
  79.    
  80.  
  81.  
  82.    
  83.    
  84.     @EventHandler
  85.     public void Load(FMLPreInitializationEvent Event){
  86.        
  87.        
  88.        
  89.        
  90.        
  91.        
  92.  
  93.        
  94.        
  95.        
  96.         //Registering tools
  97.        
  98.             //grey Gold
  99.         GameRegistry.registerItem(greyGoldSword, "greyGoldSword");
  100.         LanguageRegistry.addName(greyGoldSword, "Grey Gold Sword");
  101.        
  102.         GameRegistry.registerItem(greyGoldPickaxe, "greyGoldPickaxe");
  103.         LanguageRegistry.addName(greyGoldPickaxe, "Grey Gold Pickaxe");
  104.        
  105.         GameRegistry.registerItem(greyGoldAxe, "greyGoldAxe");
  106.         LanguageRegistry.addName(greyGoldAxe, "Grey Gold Axe");
  107.        
  108.         GameRegistry.registerItem(greyGoldShovel, "greyGoldShovel");
  109.         LanguageRegistry.addName(greyGoldShovel, "Grey Gold Shovel");
  110.        
  111.         GameRegistry.registerItem(greyGoldHoe, "greyGoldHoe");
  112.         LanguageRegistry.addName(greyGoldHoe, "Grey Gold Hoe");
  113.        
  114.             //rose Gold
  115.         GameRegistry.registerItem(roseGoldSword, "roseGoldSword");
  116.         LanguageRegistry.addName(roseGoldSword, "Rose Gold Sword");
  117.        
  118.         GameRegistry.registerItem(roseGoldPickaxe, "roseGoldPickaxe");
  119.         LanguageRegistry.addName(roseGoldPickaxe, "Rose Gold Pickaxe");
  120.        
  121.         GameRegistry.registerItem(roseGoldAxe, "roseGoldAxe");
  122.         LanguageRegistry.addName(roseGoldAxe, "Rose Gold Axe");
  123.        
  124.         GameRegistry.registerItem(roseGoldShovel, "roseGoldShovel");
  125.         LanguageRegistry.addName(roseGoldShovel, "Rose Gold Shovel");
  126.        
  127.         GameRegistry.registerItem(roseGoldHoe, "roseGoldHoe");
  128.         LanguageRegistry.addName(roseGoldHoe, "Rose Gold Hoe");
  129.        
  130.        
  131.  
  132.         //Defining tool Recipes
  133.        
  134.             //Grey Gold
  135.         GameRegistry.addRecipe(new ItemStack (greyGoldSword), new Object[] {" G "," G "," S ",
  136.             'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
  137.        
  138.         GameRegistry.addRecipe(new ItemStack (greyGoldPickaxe), new Object[] {"GGG"," S "," S ",
  139.             'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
  140.        
  141.         GameRegistry.addRecipe(new ItemStack (greyGoldAxe), new Object[] {"GG ","GS "," S ",
  142.             'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
  143.        
  144.         GameRegistry.addRecipe(new ItemStack (greyGoldShovel), new Object[] {" G "," S "," S ",
  145.             'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
  146.        
  147.         GameRegistry.addRecipe(new ItemStack (greyGoldHoe), new Object[] {"GG "," S "," S ",
  148.             'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
  149.        
  150.        
  151.        
  152.             //Rose Gold
  153.         GameRegistry.addRecipe(new ItemStack (roseGoldSword), new Object[] {" R "," R "," S ",
  154.             'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
  155.        
  156.         GameRegistry.addRecipe(new ItemStack (roseGoldPickaxe), new Object[] {"RRR"," S "," S ",
  157.             'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
  158.        
  159.         GameRegistry.addRecipe(new ItemStack (roseGoldAxe), new Object[] {"RR ","RS "," S ",
  160.             'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
  161.        
  162.         GameRegistry.addRecipe(new ItemStack (roseGoldShovel), new Object[] {" R "," S "," S ",
  163.             'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
  164.        
  165.         GameRegistry.addRecipe(new ItemStack (roseGoldHoe), new Object[] {"RR "," S "," S ",
  166.             'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
  167.        
  168.        
  169.        
  170.         //Registering Items
  171.         GameRegistry.registerItem(greyGoldIngot, "greyGoldIngot");
  172.         LanguageRegistry.addName(greyGoldIngot, "Grey Gold Ingot");
  173.        
  174.         GameRegistry.registerItem(roseGoldIngot, "roseGoldIngot");
  175.         LanguageRegistry.addName(roseGoldIngot, "Rose Gold Ingot");
  176.        
  177.         GameRegistry.registerItem(muttonRaw, "muttonRaw");
  178.         LanguageRegistry.addName(muttonRaw, "Raw Mutton");
  179.        
  180.         GameRegistry.registerItem(muttonCooked, "muttonCooked");
  181.         LanguageRegistry.addName(muttonCooked, "Cooked Mutton");
  182.        
  183.         //Defining item recipes
  184.  
  185.         GameRegistry.addShapelessRecipe(new ItemStack (greyGoldIngot, 2), new ItemStack(Item.ingotGold), new ItemStack(Item.ingotIron));
  186.         GameRegistry.addShapelessRecipe(new ItemStack (greyGoldIngot, 9), new ItemStack(skysound.newtools.ToolsMain.greyGoldBlock));
  187.        
  188.         GameRegistry.addShapelessRecipe(new ItemStack (roseGoldIngot, 2), new ItemStack(Item.ingotGold), new ItemStack(Item.redstone));
  189.         GameRegistry.addShapelessRecipe(new ItemStack (roseGoldIngot, 9), new ItemStack(skysound.newtools.ToolsMain.roseGoldBlock));
  190.        
  191.             //Smelting
  192.         GameRegistry.addSmelting(skysound.newtools.ToolsMain.muttonRaw.itemID, new ItemStack(muttonCooked, 1), 0.1f);
  193.        
  194.         //Registering blocks
  195.         GameRegistry.registerBlock(greyGoldBlock, "greyGoldBlock");
  196.         LanguageRegistry.addName(greyGoldBlock, "Grey Gold Block");
  197.        
  198.         GameRegistry.registerBlock(roseGoldBlock, "roseGoldBlock");
  199.         LanguageRegistry.addName(roseGoldBlock, "Rose Gold Block");
  200.        
  201.         //Defining block recipes
  202.        
  203.         GameRegistry.addRecipe(new ItemStack (greyGoldBlock), new Object[] {"GGG", "GGG", "GGG",
  204.         'G', skysound.newtools.ToolsMain.greyGoldIngot});
  205.        
  206.         GameRegistry.addRecipe(new ItemStack (roseGoldBlock), new Object[] {"RRR", "RRR", "RRR",
  207.         'R', skysound.newtools.ToolsMain.roseGoldIngot});
  208.        
  209.        
  210.        
  211.         //Naming/Registering other shiz
  212.        
  213.         LanguageRegistry.instance().addStringLocalization("itemGroup.tabNewTools", "en_US", "Tools+");  
  214.     }
  215.  
  216. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement