Advertisement
Guest User

Exocraft.Main

a guest
Dec 17th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.19 KB | None | 0 0
  1. package ExoCraft.Main;
  2.  
  3. import java.io.File;
  4.  
  5. import ExoCraft.Main.Items.Amethyst;
  6. import ExoCraft.Main.Items.Peridot;
  7. import ExoCraft.Main.Items.Prompt;
  8. import ExoCraft.Main.Items.Tanzanite;
  9. import ExoCraft.Main.Items.TanzaniteShard;
  10. import ExoCraft.Main.Ores.BlockAmethystOre;
  11. import ExoCraft.Main.Ores.BlockPeridotOre;
  12. import ExoCraft.Main.Ores.BlockTanzaniteShardOre;
  13. import ExoCraft.Main.Tools.AmethystAxe;
  14. import ExoCraft.Main.Tools.AmethystPickaxe;
  15. import ExoCraft.Main.Tools.AmethystSword;
  16. import ExoCraft.Main.Tools.PeridotAxe;
  17. import ExoCraft.Main.Tools.PeridotPickaxe;
  18. import ExoCraft.Main.Tools.PeridotSword;
  19. import ExoCraft.Main.Tools.Spear;
  20. import ExoCraft.Main.Tools.TanzaniteAxe;
  21. import ExoCraft.Main.Tools.TanzanitePickaxe;
  22. import ExoCraft.Main.Tools.TanzaniteSuperSword;
  23. import net.minecraft.block.Block;
  24. import net.minecraft.block.material.Material;
  25. import net.minecraft.creativetab.CreativeTabs;
  26. import net.minecraft.item.EnumToolMaterial;
  27. import net.minecraft.item.Item;
  28. import net.minecraft.item.ItemStack;
  29. import net.minecraftforge.common.Configuration;
  30. import net.minecraftforge.common.EnumHelper;
  31. import cpw.mods.fml.common.Mod;
  32. import cpw.mods.fml.common.Mod.EventHandler;
  33. import cpw.mods.fml.common.Mod.Instance;
  34. import cpw.mods.fml.common.SidedProxy;
  35. import cpw.mods.fml.common.event.FMLInitializationEvent;
  36. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  37. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  38. import cpw.mods.fml.common.network.NetworkMod;
  39. import cpw.mods.fml.common.registry.GameRegistry;
  40. import cpw.mods.fml.common.registry.LanguageRegistry;
  41.  
  42. //Define Basic Information For Mod
  43. @Mod(modid="exocraft", name="ExoCraft", version="Alpha v1.1")
  44.  
  45. //Define CLient & Server Side Requirement's
  46. @NetworkMod(clientSideRequired=true, serverSideRequired=false)
  47. public class Main {
  48.  
  49. //Enum Tool Materials
  50. public EnumToolMaterial tanzanite = EnumHelper.addToolMaterial("Tanzanite", 3, 10000, 25.0F, 15.0F, 30);
  51. public EnumToolMaterial spear = EnumHelper.addToolMaterial("spear", 3, 500, 20.0F, 10.0F, 0);
  52. public EnumToolMaterial amethsyt = EnumHelper.addToolMaterial("Amethsyt", 3, 2500, 15.0F, 10.0F, 20);
  53. public EnumToolMaterial peridot = EnumHelper.addToolMaterial("Peridot", 3, 5000, 20.0F, 7.5F, 25);
  54.  
  55. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  56.  
  57. //Declare Stuff
  58. public static int TanzaniteShardOreID = 3500;
  59. public static int TanzaniteShardID = 4000;
  60. public static int TanzaniteID = 4001;
  61. public static int PromptID = 4002;
  62. public static int TanzaniteSuperSwordID = 4003;
  63. public static int TanzanitePickaxeID = 4004;
  64. public static int TanzaniteAxeID = 4005;
  65. public static int SpearID = 4006;
  66. public static int AmethystID = 4007;
  67. public static int AmethystOreID = 3501;
  68. public static int AmethystSwordID= 4008;
  69. public static int AmethystPickaxeID = 4009;
  70. public static int AmethystAxeID = 4010;
  71. public static int PeridotID = 4011;
  72. public static int PeridotOreID = 3502;
  73. public static int PeridotSwordID = 4012;
  74. public static int PeridotPickaxeID = 4013;
  75. public static int PeridotAxeID = 4014;
  76.  
  77. //Define Tools
  78. public static Item TanzaniteSuperSword;
  79. public static Item TanzanitePickaxe;
  80. public static Item TanzaniteAxe;
  81. public static Item Spear;
  82. public static Item AmethystSword;
  83. public static Item AmethystPickaxe;
  84. public static Item AmethystAxe;
  85. public static Item PeridotSword;
  86. public static Item PeridotPickaxe;
  87. public static Item PeridotAxe;
  88.  
  89. //Define Blocks and Ores
  90. public static Block TanzaniteShardOre;
  91. public static Block AmethystOre;
  92. public static Block PeridotOre;
  93.  
  94. //Define Items
  95. public static Item TanzaniteShard;
  96. public static Item Tanzanite;
  97. public static Item Prompt;
  98. public static Item Amethyst;
  99. public static Item Peridot;
  100.  
  101. @EventHandler
  102. public void initConfiguration(FMLPreInitializationEvent event){
  103. // === Creates The .cfg File === \\
  104. Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  105. // === Loads The .cfg File === \\
  106. config.load();
  107. TanzaniteShardOreID = config.get("Ore", "TanzaniteShardOre", TanzaniteShardOreID).getInt();
  108. TanzaniteShardID = config.get("Gem", "TanzaniteShard", TanzaniteShardID).getInt();
  109. TanzaniteID = config.get("Gem", "Tanzanite", TanzaniteID).getInt();
  110. PromptID = config.get("Other", "Prompt", PromptID).getInt();
  111. TanzaniteSuperSwordID = config.get("Sword", "TanzaniteSuperSword", TanzaniteSuperSwordID).getInt();
  112. TanzanitePickaxeID = config.get("PickAxe", "TanzanitePickaxe", TanzanitePickaxeID).getInt();
  113. TanzaniteAxeID = config.get("Axe", "TanzaniteAxe", TanzaniteAxeID).getInt();
  114. SpearID = config.get("Other", "Spear", SpearID).getInt();
  115. AmethystID = config.get("Gem", "Amethyst", AmethystID).getInt();
  116. AmethystOreID = config.get("Ore", "AmethystOre", AmethystOreID).getInt();
  117. AmethystSwordID = config.get("Sword", "AmethystSword", AmethystSwordID).getInt();
  118. AmethystPickaxeID = config.get("PickAxe", "AmethystPickaxe", AmethystPickaxeID).getInt();
  119. AmethystAxeID = config.get("Axe", "AmethystAxe", AmethystAxeID).getInt();
  120. PeridotID = config.get("Gem", "Peridot", PeridotID).getInt();
  121. PeridotOreID = config.get("Ore", "PeridotOre", PeridotOreID).getInt();
  122. PeridotSwordID = config.get("Sword", "PeridotSword", PeridotSwordID).getInt();
  123. PeridotPickaxeID = config.get("Pickaxe", "PeridotPickaxe", PeridotPickaxeID).getInt();
  124. PeridotAxeID = config.get("Axe", "PeridotAxe", PeridotAxeID).getInt();
  125. config.save();
  126. // === Saves The .cfg File === \\
  127.  
  128. }
  129.  
  130.  
  131.  
  132.  
  133. @EventHandler
  134. public void preInit(FMLPreInitializationEvent event) {
  135.  
  136. //Settings for Blocks and Ores
  137. TanzaniteShardOre = new BlockTanzaniteShardOre(3500, Material.rock).setUnlocalizedName("exocraft:TanzaniteShardOre");
  138. AmethystOre = new BlockAmethystOre(3501, Material.rock).setUnlocalizedName("exocraft:AmethystOre");
  139. PeridotOre = new BlockPeridotOre(3502, Material.rock).setUnlocalizedName("exocraft:PeridotOre");
  140.  
  141. //Settings for Items
  142. TanzaniteShard = new TanzaniteShard(4000).setUnlocalizedName("exocraft:TanzaniteShard");
  143. Tanzanite = new Tanzanite(4001).setUnlocalizedName("exocraft:Tanzanite");
  144. Prompt = new Prompt(4002).setUnlocalizedName("exocraft:Prompt");
  145. Amethyst = new Amethyst(4007).setUnlocalizedName("exocraft:Amethyst");
  146. Peridot = new Peridot(4011).setUnlocalizedName("exocraft:Peridot");
  147.  
  148. //Settings for Tools
  149. TanzaniteSuperSword = new TanzaniteSuperSword(4003, tanzanite).setUnlocalizedName("TanzaniteSuperSword");
  150. TanzanitePickaxe = new TanzanitePickaxe(4004, tanzanite).setUnlocalizedName("TanzanitePickaxe");
  151. TanzaniteAxe = new TanzaniteAxe(4005, tanzanite).setUnlocalizedName("TanzaniteAxe");
  152. Spear = new Spear(4006, spear).setUnlocalizedName("Spear");
  153. AmethystSword = new AmethystSword(4008, amethsyt).setUnlocalizedName("AmethystSword");
  154. AmethystPickaxe = new AmethystPickaxe(4009, amethsyt).setUnlocalizedName("AmethystPickaxe");
  155. AmethystAxe = new AmethystAxe(4010, amethsyt).setUnlocalizedName("AmethystAxe");
  156. PeridotSword = new PeridotSword(4012, peridot).setUnlocalizedName("PeridotSword");
  157. PeridotPickaxe = new PeridotPickaxe(4013, peridot).setUnlocalizedName("PeridotPickaxe");
  158. PeridotAxe = new PeridotAxe(4014, peridot).setUnlocalizedName("PeridotAxe");
  159.  
  160. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  161.  
  162. //Register Ores
  163. GameRegistry.registerBlock(TanzaniteShardOre, "TanzaniteShardOre");
  164. LanguageRegistry.addName(TanzaniteShardOre, "TanzaniteShardOre");
  165.  
  166. GameRegistry.registerBlock(AmethystOre, "AmethystOre");
  167. LanguageRegistry.addName(AmethystOre, "AmethystOre");
  168.  
  169. GameRegistry.registerBlock(PeridotOre, "PeridotOre");
  170. LanguageRegistry.addName(PeridotOre, "PeridotOre");
  171. //Register Items
  172. LanguageRegistry.addName(TanzaniteShard, "TanzaniteShard");
  173. LanguageRegistry.addName(Tanzanite, "Tanzanite");
  174. LanguageRegistry.addName(Prompt, "Prompt");
  175. LanguageRegistry.addName(Amethyst, "Amethyst");
  176. LanguageRegistry.addName(Peridot, "Peridot");
  177.  
  178. //Register Tools
  179. //Swords
  180. GameRegistry.registerItem(TanzaniteSuperSword, "TanzaniteSuperSword");
  181. LanguageRegistry.addName(TanzaniteSuperSword, "Tanzanite Super Sword");
  182.  
  183. GameRegistry.registerItem(PeridotSword, "PeridotSword");
  184. LanguageRegistry.addName(PeridotSword, "Peridot Sword");
  185.  
  186. GameRegistry.registerItem(PeridotSword, "PeridotSword");
  187. LanguageRegistry.addName(PeridotSword, "Peridot Sword");
  188. //Picks
  189. GameRegistry.registerItem(TanzanitePickaxe, "TanzanitePickaxe");
  190. LanguageRegistry.addName(TanzanitePickaxe, " Tanzanite Pickaxe");
  191.  
  192. GameRegistry.registerItem(AmethystPickaxe, "AmethystPickaxe");
  193. LanguageRegistry.addName(AmethystPickaxe, " Amethyst Pickaxe");
  194.  
  195. GameRegistry.registerItem(PeridotPickaxe, "PeridotPickaxe");
  196. LanguageRegistry.addName(PeridotPickaxe, " Peridot Pickaxe");
  197. //Axes
  198. GameRegistry.registerItem(TanzaniteAxe, "TanzaniteAxe");
  199. LanguageRegistry.addName(TanzaniteAxe, "Tanzanite Axe");
  200.  
  201. GameRegistry.registerItem(AmethystAxe, "AmethystAxe");
  202. LanguageRegistry.addName(AmethystAxe, "Amethyst Axe");
  203.  
  204. GameRegistry.registerItem(PeridotAxe, "PeridotAxe");
  205. LanguageRegistry.addName(PeridotAxe, "Peridot Axe");
  206. //Other
  207. GameRegistry.registerItem(Spear, "Spear");
  208. LanguageRegistry.addName(Spear, "Spear");
  209.  
  210. //Recipes for Items
  211. GameRegistry.addRecipe(new ItemStack(Main.Prompt), new Object[]{ "111", "101", "AAA", '0', Item.redstone, '1', Item.ingotIron, 'A', Main.Amethyst});
  212. GameRegistry.addRecipe(new ItemStack(Block.commandBlock), new Object[]{ "101", "020", "101", '0', Item.leather, '1', Item.ingotIron, '2', Main.Prompt });
  213. GameRegistry.addRecipe(new ItemStack(Main.Tanzanite), new Object[]{ " 0 ", "0 0", " 0 ", '0', Main.TanzaniteShard});
  214. GameRegistry.addRecipe(new ItemStack(Main.TanzaniteSuperSword), new Object[]{ "E0E", "F1F", "L1L", '0', Main.Tanzanite, '1', Item.stick, 'F', Item.flintAndSteel, 'L', Item.bucketLava, 'E', Item.eyeOfEnder});
  215. GameRegistry.addRecipe(new ItemStack(Main.TanzanitePickaxe), new Object []{ "111", " 0 ", " 0 ", '0', Item.stick, '1', Main.Tanzanite});
  216. GameRegistry.addRecipe(new ItemStack(Main.TanzaniteAxe), new Object []{ "11 ", "10 ", " 0 ", '0', Item.stick, '1', Main.Tanzanite});
  217. GameRegistry.addRecipe(new ItemStack(Main.Spear), new Object []{ " 1 ", " 0 ", " 0 ", '0', Item.stick, '1', Item.flint});
  218. GameRegistry.addRecipe(new ItemStack(Main.AmethystSword), new Object []{ " 1 ", " 1 ", " 0 ", '0', Item.stick, '1', Main.Amethyst});
  219. GameRegistry.addRecipe(new ItemStack(Main.AmethystPickaxe), new Object []{ "111", " 0 ", " 0 ", '0', Item.stick, '1', Main.Amethyst});
  220. GameRegistry.addRecipe(new ItemStack(Main.AmethystAxe), new Object []{ "11 ", "10 ", " 0 ", '0', Item.stick, '1', Main.Amethyst});
  221. GameRegistry.addRecipe(new ItemStack(Main.PeridotSword), new Object []{ " 1 ", " 1 ", " 0 ", '0', Item.stick, '1', Main.Peridot});
  222. GameRegistry.addRecipe(new ItemStack(Main.PeridotPickaxe), new Object []{ "111", " 0 ", " 0 ", '0', Item.stick, '1', Main.Peridot});
  223. GameRegistry.addRecipe(new ItemStack(Main.PeridotAxe), new Object []{ "11 ", "10 ", " 0 ", '0', Item.stick, '1', Main.Peridot});
  224.  
  225. //Smelting
  226. GameRegistry.addSmelting(Main.TanzaniteShardOre.blockID, new ItemStack(Main.TanzaniteShard), 20.0F);
  227. GameRegistry.addSmelting(Main.AmethystOre.blockID, new ItemStack(Main.Amethyst), 5.0F);
  228. GameRegistry.addSmelting(Main.PeridotOre.blockID, new ItemStack(Main.Peridot), 10.0F);
  229.  
  230. }
  231.  
  232. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement