Guest User

SeroeMod

a guest
Oct 19th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. package Seroemod;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  5. import net.minecraft.item.EnumToolMaterial;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraftforge.common.EnumHelper;
  9. import net.minecraftforge.common.MinecraftForge;
  10. import Seroemod.Blocks.SapphireBlock;
  11. import Seroemod.Bow.SapphireArrow;
  12. import Seroemod.Items.SapphireGem;
  13. import Seroemod.Items.SapphireShard;
  14. import Seroemod.Lightsabers.BlueLightsaber;
  15. import Seroemod.Lightsabers.BlueLightsaberHilt;
  16. import Seroemod.Lightsabers.LightsaberHilt;
  17. import Seroemod.Ore.SapphireOre;
  18. import Seroemod.Ore.SapphireWorldGeneration;
  19. import Seroemod.Tools.ToolSapphireAxe;
  20. import Seroemod.Tools.ToolSapphireHoe;
  21. import Seroemod.Tools.ToolSapphirePickaxe;
  22. import Seroemod.Tools.ToolSapphireShovel;
  23. import Seroemod.Tools.ToolSapphireSword;
  24. import cpw.mods.fml.common.Mod;
  25. import cpw.mods.fml.common.Mod.EventHandler;
  26. import cpw.mods.fml.common.event.FMLLoadEvent;
  27. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  28. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  29. import cpw.mods.fml.common.event.FMLServerStartingEvent;
  30. import cpw.mods.fml.common.network.NetworkMod;
  31. import cpw.mods.fml.common.registry.GameRegistry;
  32. import cpw.mods.fml.common.registry.LanguageRegistry;
  33.  
  34.  
  35. @Mod(modid = "seroemod", name = "Seroe's Mod", version = "0.1")
  36. @NetworkMod(clientSideRequired = true, serverSideRequired = false)
  37. public class SeroeMod
  38. {
  39. // === Blocks === //
  40. // Block Section
  41. public static Block sapphireBlock, sapphireOre, amethystOre;
  42.  
  43. // Block IDs
  44. int sapphireBlockID = 3000;
  45. int sapphireOreBlockID = 3001;
  46. int amethystOreBlockID = 3002;
  47.  
  48. // === Items === ///
  49. // Item Section
  50. // Sapphire
  51. public static Item sapphireGem, sapphireShard, amethystGem, sapphireSword, sapphireShovel, sapphireAxe, sapphirePickaxe, sapphireHoe;
  52. // Lightsaber
  53. public static Item hiltLightsaber, blueLightsaber, hiltBlueLightsaber;
  54. // Arrow
  55. public static Item sapphireArrow;
  56.  
  57.  
  58. // Materials
  59. public static EnumToolMaterial Sapphire = EnumHelper.addToolMaterial("Sapphire", 2, 1033, 7.0F, 2.5F, 20);
  60. public static EnumToolMaterial Kyber = EnumHelper.addToolMaterial("Kyber", 1, 100, 0.0F, 3.5F, 1);
  61.  
  62.  
  63. // Item IDs
  64. static int sapphireGemID = 4000 - 256;
  65. static int sapphireShardID = 4001 - 256;
  66. static int amethystGemID = 4002 - 256;
  67. static int sapphireSwordID = 4003 - 256;
  68. static int sapphireShovelID = 4004 - 256;
  69. static int sapphireAxeID = 4005 - 256;
  70. static int sapphirePickaxeID = 4006 - 256;
  71. static int sapphireHoeID = 4007 - 256;
  72. static int hiltLightsaberID = 4008 - 256;
  73. static int blueLightsaberID = 4009 - 256;
  74. static int hiltBlueLightsaberID = 4010 - 256;
  75. static int sapphireArrowID = 4011 - 256;
  76.  
  77. // Instance of our mod
  78. public static SeroeMod instance;
  79.  
  80. @EventHandler
  81. public void preInit(FMLPreInitializationEvent event)
  82. // Contains Block inits, Item inits, Tool inits, World Gen
  83. {
  84. // ==== Blocks ==== //
  85. // Sapphire Block Stuff
  86. this.sapphireBlock = new SapphireBlock(sapphireBlockID, Material.rock);
  87. LanguageRegistry.addName(sapphireBlock, "Sapphire Block");
  88. MinecraftForge.setBlockHarvestLevel(sapphireBlock, "pickaxe", 2);
  89. GameRegistry.registerBlock(sapphireBlock, "sapphireBlock");
  90.  
  91. // Sapphire Ore Stuff
  92. this.sapphireOre = new SapphireOre(sapphireOreBlockID);
  93. LanguageRegistry.addName(sapphireOre, "Sapphire Ore");
  94. MinecraftForge.setBlockHarvestLevel(sapphireOre, "pickaxe", 2);
  95. GameRegistry.registerBlock(sapphireOre, "sapphireOre");
  96.  
  97. // === Items === //
  98. // Sapphire Gem Stuff
  99. this.sapphireGem = new SapphireGem(sapphireGemID);
  100. LanguageRegistry.addName(sapphireGem, "Sapphire Gem");
  101.  
  102. // Sapphire Shard Stuff
  103. this.sapphireShard = new SapphireShard(sapphireShardID);
  104. LanguageRegistry.addName(sapphireShard, "Sapphire Shard");
  105.  
  106. // Sapphire Sword
  107. sapphireSword = new ToolSapphireSword(sapphireSwordID, Sapphire);
  108. GameRegistry.registerItem(sapphireSword, "sapphireSword");
  109. LanguageRegistry.addName(sapphireSword, "Sapphire Sword");
  110.  
  111. // Sapphire Axe
  112. sapphireAxe = new ToolSapphireAxe(sapphireAxeID, Sapphire);
  113. GameRegistry.registerItem(sapphireAxe, "sapphireAxe");
  114. LanguageRegistry.addName(sapphireAxe, "Sapphire Axe");
  115.  
  116. // Sapphire Hoe
  117. sapphireHoe = new ToolSapphireHoe(sapphireHoeID, Sapphire);
  118. GameRegistry.registerItem(sapphireHoe, "sapphireHoe");
  119. LanguageRegistry.addName(sapphireHoe, "Sapphire Hoe");
  120.  
  121. // Sapphire Shovel
  122. sapphireShovel = new ToolSapphireShovel(sapphireShovelID, Sapphire);
  123. GameRegistry.registerItem(sapphireShovel, "sapphireShovel");
  124. LanguageRegistry.addName(sapphireShovel, "Sapphire Shovel");
  125.  
  126. // Sapphire Pickaxe
  127. sapphirePickaxe = new ToolSapphirePickaxe(sapphirePickaxeID, Sapphire);
  128. GameRegistry.registerItem(sapphirePickaxe, "sapphirePickaxe");
  129. LanguageRegistry.addName(sapphirePickaxe, "Sapphire Pickaxe");
  130.  
  131. // Lightsaber Hilt
  132. hiltLightsaber = new LightsaberHilt(hiltLightsaberID);
  133. LanguageRegistry.addName(hiltLightsaber, "Lightsaber Hilt");
  134.  
  135. // Blue Lightsaber
  136. blueLightsaber = new BlueLightsaber(blueLightsaberID, Kyber);
  137. GameRegistry.registerItem(blueLightsaber, "blueLightsaber");
  138. LanguageRegistry.addName(blueLightsaber, "Blue Lightsaber");
  139.  
  140. // Blue Lightsaber Hilt
  141. hiltBlueLightsaber = new BlueLightsaberHilt(hiltBlueLightsaberID);
  142. LanguageRegistry.addName(hiltBlueLightsaber, "Blue Lightsaber Hilt");
  143.  
  144.  
  145.  
  146. // Arrow
  147. sapphireArrow = new SapphireArrow(sapphireArrowID);
  148. LanguageRegistry.addName(sapphireArrow, "Sapphire Arrow");
  149.  
  150. // === Sounds === //
  151. MinecraftForge.EVENT_BUS.register(new SeroeModSound());
  152.  
  153.  
  154. // === World Generation === //
  155. GameRegistry.registerWorldGenerator(new SapphireWorldGeneration());
  156.  
  157. // === RECIPES === //
  158.  
  159. // Item Stacks
  160. ItemStack sapphireStack = new ItemStack(sapphireGem, 9);
  161. ItemStack sapphireShardStack = new ItemStack(sapphireShard, 9);
  162.  
  163. // === Shaped Crafting Recipes === //
  164.  
  165. // Sapphire Block
  166. GameRegistry.addRecipe(new ItemStack(sapphireBlock),
  167. "xxx", "xxx", "xxx",
  168. 'x', sapphireGem
  169. );
  170.  
  171. // Sapphire Gem
  172. GameRegistry.addRecipe(new ItemStack(sapphireGem),
  173. "xxx", "xxx", "xxx",
  174. 'x', sapphireShard
  175. );
  176.  
  177. // Sapphire Sword
  178. GameRegistry.addRecipe(new ItemStack(sapphireSword),
  179. " x ", " x ", " y ",
  180. 'x', sapphireGem,
  181. 'y', Item.stick
  182. );
  183.  
  184. // Sapphire Axe 1
  185. GameRegistry.addRecipe(new ItemStack(sapphireAxe),
  186. "xx ", "xy ", " y ",
  187. 'x', sapphireGem,
  188. 'y', Item.stick
  189. );
  190.  
  191. // Sapphire Axe 2
  192. GameRegistry.addRecipe(new ItemStack(sapphireAxe),
  193. " xx", " yx", " y ",
  194. 'x', sapphireGem,
  195. 'y', Item.stick
  196. );
  197.  
  198. // Sapphire Hoe 1
  199. GameRegistry.addRecipe(new ItemStack(sapphireHoe),
  200. "xx ", " y ", " y ",
  201. 'x', sapphireGem,
  202. 'y', Item.stick
  203. );
  204.  
  205. // Sapphire Hoe 2
  206. GameRegistry.addRecipe(new ItemStack(sapphireHoe),
  207. " xx", " y ", " y ",
  208. 'x', sapphireGem,
  209. 'y', Item.stick
  210. );
  211.  
  212. // Sapphire Shovel
  213. GameRegistry.addRecipe(new ItemStack(sapphireShovel),
  214. " x ", " y ", " y ",
  215. 'y', Item.stick,
  216. 'x', sapphireGem
  217. );
  218.  
  219. // Sapphire Pickaxe
  220. GameRegistry.addRecipe(new ItemStack(sapphirePickaxe),
  221. "xxx", " y ", " y ",
  222. 'x', sapphireGem,
  223. 'y', Item.stick
  224. );
  225.  
  226. // Lightsaber Hilt
  227. GameRegistry.addRecipe(new ItemStack(hiltLightsaber),
  228. " x ", " y ", " z ",
  229. 'x', Item.diamond,
  230. 'y', Item.redstone,
  231. 'z', Item.ingotIron
  232. );
  233.  
  234. /* // Blue Lightsaber
  235. GameRegistry.addRecipe(new ItemStack(blueLightsaber),
  236. " x ", " x ", " z ",
  237. 'x', sapphireGem,
  238. 'z', hiltLightsaber
  239. );
  240. */
  241. // Blue Lightsaber Hilt
  242. GameRegistry.addRecipe(new ItemStack(hiltBlueLightsaber),
  243. " x ", " x ", " z ",
  244. 'x', sapphireGem,
  245. 'z', hiltLightsaber
  246. );
  247.  
  248.  
  249. // === Shapeless Crafting Recipes === //
  250.  
  251. // Sapphires
  252. GameRegistry.addShapelessRecipe(sapphireStack, sapphireBlock);
  253.  
  254. // Sapphire Shards
  255. GameRegistry.addShapelessRecipe(sapphireShardStack, sapphireGem);
  256. }
  257.  
  258. @EventHandler
  259. public void load(FMLLoadEvent event)
  260. // Contains itemstacks and recipes
  261. {
  262.  
  263.  
  264. }
  265.  
  266. @EventHandler
  267. public void postInit(FMLPostInitializationEvent event)
  268. {
  269.  
  270. }
  271.  
  272. @EventHandler
  273. public void serverStart(FMLServerStartingEvent event)
  274. {
  275.  
  276. }
  277. }
Advertisement
Add Comment
Please, Sign In to add comment