Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. ConfigurationHelper:
  2. package terramagna.helpers;
  3.  
  4. import net.minecraftforge.common.Configuration;
  5.  
  6. public class ConfigurationHelper
  7. {
  8.  
  9. public static Configuration config;
  10.  
  11. private static int itemID = 11999;
  12. private static int blockID = 2999;
  13.  
  14. public static void init()
  15. {
  16. System.out.println("Check1");
  17. try{
  18. config = new Configuration();
  19. }catch(Exception e){e.printStackTrace();}
  20. System.out.println("Check2");
  21.  
  22. config.load();
  23.  
  24. }
  25.  
  26. public static int addItem(String name)
  27. {
  28.  
  29. itemID++;
  30.  
  31. config.get("Items", name, itemID);
  32.  
  33. return itemID;
  34.  
  35. }
  36.  
  37. public static int addBlock(String name)
  38. {
  39.  
  40. blockID++;
  41.  
  42. config.get("Blocks", name, blockID);
  43.  
  44. return blockID;
  45.  
  46. }
  47.  
  48. public static void initPost()
  49. {
  50.  
  51. config.save();
  52.  
  53. }
  54.  
  55. }
  56.  
  57.  
  58.  
  59.  
  60. ServerProxy:
  61.  
  62. package terramagna;
  63.  
  64. import terramagna.helpers.*;
  65.  
  66. public class ServerProxy
  67. {
  68.  
  69. public void registerRenderers()
  70. {}
  71.  
  72. public static void init()
  73. {
  74.  
  75. ConfigurationHelper.init();
  76. MiscHelper.init();
  77. OverworldBlockHelper.init();
  78. OverworldItemHelper.init();
  79. BiomeHelper.init();
  80. WorldGenHelper.init();
  81. RecipeHelper.init();
  82. ConfigurationHelper.initPost();
  83.  
  84. }
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement