Advertisement
niel_irc

Untitled

Jun 6th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. import cpw.mods.fml.common.Mod;
  2. import cpw.mods.fml.common.Mod.Init;
  3. import cpw.mods.fml.common.SidedProxy;
  4. import cpw.mods.fml.common.event.FMLInitializationEvent;
  5. import cpw.mods.fml.common.network.NetworkMod;
  6. import cpw.mods.fml.common.registry.EntityRegistry;
  7. import cpw.mods.fml.common.registry.GameRegistry;
  8. import cpw.mods.fml.common.registry.LanguageRegistry;
  9. import lib.Refrence;
  10. import mods.Pasta.textures.EntityCharKarb;
  11. import net.minecraft.block.Block;
  12. import net.minecraft.block.material.Material;
  13. import net.minecraft.entity.Entity;
  14. import net.minecraft.entity.EntityEggInfo;
  15. import net.minecraft.entity.EntityList;
  16. import net.minecraft.entity.EnumCreatureType;
  17. import net.minecraft.item.Item;
  18. import net.minecraft.item.ItemStack;
  19. import net.minecraft.world.biome.BiomeGenBase;
  20.  
  21.  
  22. @Mod( modid = Refrence.MOD_ID, name = Refrence.MOD_NAME, version = Refrence.VERSION)
  23.  
  24. @NetworkMod(clientSideRequired = true, serverSideRequired = false)
  25. public class KnackCraft
  26. {
  27. public static final String modid = "Refrence.MOD_ID";
  28.  
  29. public static Block BlockCompressedCoal;
  30.  
  31. public static Block BlockCompactCoal;
  32.  
  33. public static Block BlockNuke;
  34.  
  35.  
  36.  
  37.  
  38. @SidedProxy(clientSide="ClientProxy", serverSide="CommonProxy")
  39. public static CommonProxy proxy;
  40.  
  41. public static int startEntityId = 300;
  42.  
  43.  
  44.  
  45. @Init
  46. public void Init(FMLInitializationEvent event)
  47. {
  48.  
  49. //entities
  50.  
  51. EntityRegistry.registerModEntity(EntityCharKarb.class, "CharKarb", 1, this, 80, 3, true);
  52.  
  53. EntityRegistry.addSpawn(EntityCharKarb.class, 1, 0, 1, EnumCreatureType.creature, BiomeGenBase.hell);
  54.  
  55. LanguageRegistry.instance().addStringLocalization("entity.KackCraft.CharKarb.name", "CharKarb");
  56.  
  57. registerEntityEgg(EntityCharKarb.class, 0x4DF, 0x4DF);
  58.  
  59.  
  60.  
  61. //Blocks
  62.  
  63. BlockCompactCoal = new BlockCompactCoal(253, Material.rock).setUnlocalizedName("CompactCoal");
  64.  
  65. GameRegistry.registerBlock(BlockCompactCoal, modid + BlockCompactCoal.getUnlocalizedName());
  66.  
  67. LanguageRegistry.addName(BlockCompactCoal, "Compact Coal");
  68.  
  69.  
  70. BlockCompressedCoal = new BlockCompressedCoal(254, Material.rock).setUnlocalizedName("Compressed Coal");
  71.  
  72. GameRegistry.registerBlock(BlockCompressedCoal, modid + BlockCompressedCoal.getUnlocalizedName());
  73.  
  74. LanguageRegistry.addName(BlockCompressedCoal, "Compressed Coal");
  75.  
  76.  
  77. BlockNuke = new BlockNuke(255).setUnlocalizedName("Nuke");
  78.  
  79. GameRegistry.registerBlock(BlockNuke, modid + BlockNuke.getUnlocalizedName());
  80.  
  81. LanguageRegistry.addName(BlockNuke, "Nuke");
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89. //Smelting
  90.  
  91. GameRegistry.addSmelting(Block.blockRedstone.blockID, new ItemStack(Block.stoneBrick), 0.1f);
  92.  
  93.  
  94. GameRegistry.addSmelting(BlockCompressedCoal.blockID, new ItemStack(BlockCompactCoal), 0.1f);
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. //Shapless Crafting
  102.  
  103. GameRegistry.addShapelessRecipe(new ItemStack(Item.flintAndSteel), new Object[]{
  104. new ItemStack(Item.flint), new ItemStack(Item.ingotIron),
  105.  
  106. });
  107.  
  108. GameRegistry.addShapelessRecipe(new ItemStack(Block.waterlily), new Object[]{
  109. new ItemStack(Item.slimeBall), new ItemStack(Block.vine)
  110.  
  111. });
  112.  
  113.  
  114.  
  115. //Shaped Crafting
  116.  
  117. GameRegistry.addRecipe(new ItemStack(Block.portal), new Object[]{
  118. "OOO",
  119. "OYO",
  120. "OOO",
  121. 'O', Block.obsidian, 'Y', Item.flintAndSteel});
  122. GameRegistry.addRecipe(new ItemStack(Block.whiteStone, 8), new Object[]{
  123. "CCC",
  124. "COC",
  125. "CCC",
  126. 'C', Block.slowSand, 'O', Item.eyeOfEnder});
  127. GameRegistry.addRecipe(new ItemStack(Item.saddle), new Object[]{
  128. "CCC",
  129. "COC",
  130. "OPO",
  131. 'C', Item.leather, 'O', Item.ingotIron});
  132. GameRegistry.addRecipe(new ItemStack(Item.saddle), new Object[]{
  133. "CCC",
  134. "COC",
  135. "OPO",
  136. 'C', Item.leather, 'O', Item.ingotIron});
  137. GameRegistry.addRecipe(new ItemStack(BlockCompressedCoal), new Object[]{
  138. "CCC",
  139. "CCC",
  140. "CCC",
  141. 'C', Item.coal});
  142. GameRegistry.addRecipe(new ItemStack(Block.oreDiamond), new Object[]{
  143. "CCC",
  144. "CCC",
  145. "CCC",
  146. 'C', BlockCompactCoal
  147. });
  148. }
  149.  
  150.  
  151.  
  152. public static int getUniqueEntityId()
  153. {
  154. do
  155. {
  156. startEntityId++; //I MADE IT HAPPY :D
  157. }
  158. while(EntityList.getStringFromID(startEntityId) != null);
  159.  
  160.  
  161. return startEntityId;
  162. }
  163.  
  164. public static void registerEntityEgg(Class <? extends Entity> entity, int primaryColor, int secondaryColor)
  165. {
  166. int id = getUniqueEntityId();
  167. EntityList.IDtoClassMapping.put(id, entity);
  168. EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
  169. }
  170.  
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement