Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package skysound.newtools;
- import skysound.wings.Wings;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockOreStorage;
- import net.minecraft.block.StepSound;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.item.EnumToolMaterial;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemAxe;
- import net.minecraft.item.ItemFood;
- import net.minecraft.item.ItemHoe;
- import net.minecraft.item.ItemPickaxe;
- import net.minecraft.item.ItemSpade;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.ItemSword;
- import net.minecraftforge.common.EnumHelper;
- import cpw.mods.fml.common.Mod;
- import cpw.mods.fml.common.Mod.EventHandler;
- import cpw.mods.fml.common.event.FMLPreInitializationEvent;
- import cpw.mods.fml.common.network.NetworkMod;
- import cpw.mods.fml.common.registry.GameRegistry;
- import cpw.mods.fml.common.registry.LanguageRegistry;
- //Define basic information for the mod.
- @Mod(modid = "Skysound_Tools", name = "Tools+", version = "v0.0.1")
- //Define client and server-side requirements
- @NetworkMod(clientSideRequired = true, serverSideRequired = false)
- public class ToolsMain {
- //Creative Tab
- public static CreativeTabs tabNewTools = new CreativeTabs("tabNewTools") {
- public ItemStack getIconItemStack() {
- return new ItemStack(skysound.newtools.ToolsMain.greyGoldBlock, 1, 0);
- }
- };
- //Define Sounds
- public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
- //Defining the material
- public static EnumToolMaterial GreyGold = EnumHelper.addToolMaterial("GreyGold", 3, 180, 8.0f, 2.0f, 18);
- public static EnumToolMaterial RoseGold = EnumHelper.addToolMaterial("RoseGold", 3, 80, 12.0f, 1.0f, 18);
- //Define tools & tools settings
- //Grey Gold
- public static Item greyGoldSword = (new ItemSword(1000, GreyGold)).setUnlocalizedName("tools:greyGoldSword").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldSword");
- public static Item greyGoldPickaxe = (new ItemPickaxe(1001, GreyGold)).setUnlocalizedName("tools:greyGoldPickaxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldPickaxe");
- public static Item greyGoldAxe = (new ItemAxe(1002, GreyGold)).setUnlocalizedName("tools:greyGoldAxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldAxe");
- public static Item greyGoldShovel = (new ItemSpade(1003, GreyGold)).setUnlocalizedName("tools:greyGoldShovel").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldShovel");
- public static Item greyGoldHoe = (new ItemHoe(1004, GreyGold)).setUnlocalizedName("tools:greyGoldHoe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldHoe");
- //Rose Gold
- public static Item roseGoldSword = (new ItemSword(1008, RoseGold)).setUnlocalizedName("tools:roseGoldSword").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldSword");
- public static Item roseGoldPickaxe = (new ItemPickaxe(1009, RoseGold)).setUnlocalizedName("tools:roseGoldPickaxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldPickaxe");
- public static Item roseGoldAxe = (new ItemAxe(1010, RoseGold)).setUnlocalizedName("tools:roseGoldAxe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldAxe");
- public static Item roseGoldShovel = (new ItemSpade(1011, RoseGold)).setUnlocalizedName("tools:roseGoldShovel").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldShovel");
- public static Item roseGoldHoe = (new ItemHoe(1012, RoseGold)).setUnlocalizedName("tools:roseGoldHoe").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldHoe");
- //Define Items
- public static Item greyGoldIngot = (new Item(1005)).setUnlocalizedName("greyGoldIngot").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldIngot");
- public static Item muttonRaw = (new ItemFood(1006, 3, 0.3F, true)).setUnlocalizedName("muttonRaw").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:muttonRaw");
- public static Item muttonCooked = (new ItemFood(1007, 8, 0.8F, true)).setUnlocalizedName("muttonCooked").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:muttonCooked");
- public static Item roseGoldIngot = (new Item(1013)).setUnlocalizedName("roseGoldIngot").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldIngot");
- //Define blocks
- public static Block greyGoldBlock = (new BlockOreStorage(1008)).setHardness(4.0f).setResistance(10.0f).setStepSound(soundMetalFootstep).setUnlocalizedName("greyGoldBlock").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:greyGoldBlock");
- public static Block roseGoldBlock = (new BlockOreStorage(10014)).setHardness(4.0f).setResistance(10.0f).setStepSound(soundMetalFootstep).setUnlocalizedName("roseGoldBlock").setCreativeTab(ToolsMain.tabNewTools).setTextureName("tools:roseGoldBlock");
- @EventHandler
- public void Load(FMLPreInitializationEvent Event){
- //Registering tools
- //grey Gold
- GameRegistry.registerItem(greyGoldSword, "greyGoldSword");
- LanguageRegistry.addName(greyGoldSword, "Grey Gold Sword");
- GameRegistry.registerItem(greyGoldPickaxe, "greyGoldPickaxe");
- LanguageRegistry.addName(greyGoldPickaxe, "Grey Gold Pickaxe");
- GameRegistry.registerItem(greyGoldAxe, "greyGoldAxe");
- LanguageRegistry.addName(greyGoldAxe, "Grey Gold Axe");
- GameRegistry.registerItem(greyGoldShovel, "greyGoldShovel");
- LanguageRegistry.addName(greyGoldShovel, "Grey Gold Shovel");
- GameRegistry.registerItem(greyGoldHoe, "greyGoldHoe");
- LanguageRegistry.addName(greyGoldHoe, "Grey Gold Hoe");
- //rose Gold
- GameRegistry.registerItem(roseGoldSword, "roseGoldSword");
- LanguageRegistry.addName(roseGoldSword, "Rose Gold Sword");
- GameRegistry.registerItem(roseGoldPickaxe, "roseGoldPickaxe");
- LanguageRegistry.addName(roseGoldPickaxe, "Rose Gold Pickaxe");
- GameRegistry.registerItem(roseGoldAxe, "roseGoldAxe");
- LanguageRegistry.addName(roseGoldAxe, "Rose Gold Axe");
- GameRegistry.registerItem(roseGoldShovel, "roseGoldShovel");
- LanguageRegistry.addName(roseGoldShovel, "Rose Gold Shovel");
- GameRegistry.registerItem(roseGoldHoe, "roseGoldHoe");
- LanguageRegistry.addName(roseGoldHoe, "Rose Gold Hoe");
- //Defining tool Recipes
- //Grey Gold
- GameRegistry.addRecipe(new ItemStack (greyGoldSword), new Object[] {" G "," G "," S ",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (greyGoldPickaxe), new Object[] {"GGG"," S "," S ",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (greyGoldAxe), new Object[] {"GG ","GS "," S ",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (greyGoldShovel), new Object[] {" G "," S "," S ",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (greyGoldHoe), new Object[] {"GG "," S "," S ",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot,'S', Item.stick});
- //Rose Gold
- GameRegistry.addRecipe(new ItemStack (roseGoldSword), new Object[] {" R "," R "," S ",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (roseGoldPickaxe), new Object[] {"RRR"," S "," S ",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (roseGoldAxe), new Object[] {"RR ","RS "," S ",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (roseGoldShovel), new Object[] {" R "," S "," S ",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
- GameRegistry.addRecipe(new ItemStack (roseGoldHoe), new Object[] {"RR "," S "," S ",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot,'S', Item.stick});
- //Registering Items
- GameRegistry.registerItem(greyGoldIngot, "greyGoldIngot");
- LanguageRegistry.addName(greyGoldIngot, "Grey Gold Ingot");
- GameRegistry.registerItem(roseGoldIngot, "roseGoldIngot");
- LanguageRegistry.addName(roseGoldIngot, "Rose Gold Ingot");
- GameRegistry.registerItem(muttonRaw, "muttonRaw");
- LanguageRegistry.addName(muttonRaw, "Raw Mutton");
- GameRegistry.registerItem(muttonCooked, "muttonCooked");
- LanguageRegistry.addName(muttonCooked, "Cooked Mutton");
- //Defining item recipes
- GameRegistry.addShapelessRecipe(new ItemStack (greyGoldIngot, 2), new ItemStack(Item.ingotGold), new ItemStack(Item.ingotIron));
- GameRegistry.addShapelessRecipe(new ItemStack (greyGoldIngot, 9), new ItemStack(skysound.newtools.ToolsMain.greyGoldBlock));
- GameRegistry.addShapelessRecipe(new ItemStack (roseGoldIngot, 2), new ItemStack(Item.ingotGold), new ItemStack(Item.redstone));
- GameRegistry.addShapelessRecipe(new ItemStack (roseGoldIngot, 9), new ItemStack(skysound.newtools.ToolsMain.roseGoldBlock));
- //Smelting
- GameRegistry.addSmelting(skysound.newtools.ToolsMain.muttonRaw.itemID, new ItemStack(muttonCooked, 1), 0.1f);
- //Registering blocks
- GameRegistry.registerBlock(greyGoldBlock, "greyGoldBlock");
- LanguageRegistry.addName(greyGoldBlock, "Grey Gold Block");
- GameRegistry.registerBlock(roseGoldBlock, "roseGoldBlock");
- LanguageRegistry.addName(roseGoldBlock, "Rose Gold Block");
- //Defining block recipes
- GameRegistry.addRecipe(new ItemStack (greyGoldBlock), new Object[] {"GGG", "GGG", "GGG",
- 'G', skysound.newtools.ToolsMain.greyGoldIngot});
- GameRegistry.addRecipe(new ItemStack (roseGoldBlock), new Object[] {"RRR", "RRR", "RRR",
- 'R', skysound.newtools.ToolsMain.roseGoldIngot});
- //Naming/Registering other shiz
- LanguageRegistry.instance().addStringLocalization("itemGroup.tabNewTools", "en_US", "Tools+");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement