Guest User

dummymod

a guest
Nov 24th, 2012
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package dummy.dum.dummy;
  2.  
  3. import net.minecraft.src.Block;
  4. import net.minecraft.src.CreativeTabs;
  5. import net.minecraft.src.Item;
  6. import net.minecraft.src.ItemStack;
  7. import net.minecraft.src.Material;
  8. import net.minecraftforge.common.Configuration;
  9. import net.minecraftforge.common.MinecraftForge;
  10. import cpw.mods.fml.common.Mod;
  11. import cpw.mods.fml.common.Mod.Init;
  12. import cpw.mods.fml.common.Mod.Instance;
  13. import cpw.mods.fml.common.Mod.PostInit;
  14. import cpw.mods.fml.common.Mod.PreInit;
  15. import cpw.mods.fml.common.SidedProxy;
  16. import cpw.mods.fml.common.event.FMLInitializationEvent;
  17. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  18. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  19. import cpw.mods.fml.common.network.NetworkMod;
  20. import cpw.mods.fml.common.registry.GameRegistry;
  21. import cpw.mods.fml.common.registry.LanguageRegistry;
  22.  
  23. @Mod(modid="dummy", name="dummy", version="0.0.01")
  24. @NetworkMod(clientSideRequired=true, serverSideRequired=false)
  25. public class dummy{
  26.  
  27. // The instance of your mod that Forge uses.
  28. @Instance("dummy")
  29. public static dummy instance;
  30. ///id's
  31. public static int dummydirtID;
  32. public static int dummycobblestoneID;
  33. ///id's
  34. public static Block dummydirt;
  35. public static Block dummycobblestone;
  36.  
  37. @PreInit
  38. public void preInit(FMLPreInitializationEvent event) {
  39. //create config
  40. Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  41. //end of create config
  42. config.load();
  43.  
  44. dummydirtID= config.get(Configuration.CATEGORY_BLOCK, "dummydirtID", 500).getInt();
  45. dummycobblestoneID= config.get(Configuration.CATEGORY_BLOCK, "dummycobblestoneID", 501).getInt();
  46.  
  47. config.save();
  48.  
  49. }
  50.  
  51. @Init
  52. public void load(FMLInitializationEvent event) {
  53.  
  54. dummydirt = new dummydirt(dummydirtID, 2, Material.wood).setHardness(1.0F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  55. dummycobblestone = new dummycobblestone(dummycobblestoneID, 3, Material.wood).setHardness(1.0F).setStepSound(Block.soundWoodFootstep).setBlockName("compact cobblestone").setCreativeTab(CreativeTabs.tabBlock);
  56.  
  57.  
  58. LanguageRegistry.addName(dummydirt, "compact Dirt");
  59. MinecraftForge.setBlockHarvestLevel(dummydirt, "axe", 0);
  60. GameRegistry.registerBlock(dummydirt);
  61.  
  62. LanguageRegistry.addName(dummycobblestone, "compact cobblestone");
  63. MinecraftForge.setBlockHarvestLevel(dummycobblestone, "axe", 0);
  64. GameRegistry.registerBlock(dummycobblestone);
  65.  
  66. }
  67.  
  68. @PostInit
  69. public void postInit(FMLPostInitializationEvent event) {
  70. // Stub Method
  71. }
  72. }
RAW Paste Data