Guest User

Config Class

a guest
Dec 8th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.70 KB | None | 0 0
  1. package com.nightmarecreatures.main;
  2.  
  3. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  4. import net.minecraftforge.common.config.Configuration;
  5.  
  6. public class Config {
  7.  
  8.     public static int basespawn;
  9.    
  10.     public static int hollowspawnrate;
  11.     public static int mulrogspawnrate;
  12.     public static int shalrogspawnrate;
  13.     public static int skulkerspawnrate;
  14.     public static int jakkerspawnrate;
  15.     public static int kogulspawnrate;
  16.     public static int phantasmspawnrate;
  17.     public static int shudimspawnrate;
  18.     public static int hauntspawnrate;
  19.     public static int walkingnestspawnrate;
  20.     public static int driderspawnrate;
  21.    
  22.     public static int hellmultiplier;
  23.    
  24.     public static void preinit(FMLPreInitializationEvent event)
  25.     {
  26.         Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  27.         config.load();
  28.        
  29.         config.setCategoryComment(Configuration.CATEGORY_GENERAL, "The spawn weight values are multiplied by the base spawn weight for all mobs. \n"
  30.                                                                 + "The hell multiplier is used to multiply the spawns of certain mobs in the nether. \n"
  31.                                                                 + "The value range for individual spawn wieghts is 0-100 inclusive.");
  32.        
  33.         basespawn = config.getInt("Base Spawn Weight", Configuration.CATEGORY_GENERAL, 10, 0, 100, "The minimum value is 0 and the maximum is 100.");
  34.        
  35.         hollowspawnrate = config.getInt("Hollow Spawn Weight", Configuration.CATEGORY_GENERAL, 8, 0, 10, "");
  36.         mulrogspawnrate = config.getInt("Mulrog Spawn Weight", Configuration.CATEGORY_GENERAL, 4, 0, 100, "");
  37.         shalrogspawnrate = config.getInt("Shalrog Spawn Weight", Configuration.CATEGORY_GENERAL, 3, 0, 100, "");
  38.         skulkerspawnrate = config.getInt("Skulker Spawn Weight", Configuration.CATEGORY_GENERAL, 8, 0, 100, "");
  39.         jakkerspawnrate = config.getInt("Jakker Spawn Weight", Configuration.CATEGORY_GENERAL, 7, 0, 100, "");
  40.         kogulspawnrate = config.getInt("Kogul Spawn Weight", Configuration.CATEGORY_GENERAL, 6, 0, 100, "");
  41.         phantasmspawnrate = config.getInt("Phantasm Spawn Weight", Configuration.CATEGORY_GENERAL, 4, 0, 100, "");
  42.         shudimspawnrate = config.getInt("Shudim Spawn Weight", Configuration.CATEGORY_GENERAL, 3, 0, 100, "");
  43.         hauntspawnrate = config.getInt("Haunt Spawn Weight", Configuration.CATEGORY_GENERAL, 2, 0, 100, "");
  44.         walkingnestspawnrate = config.getInt("Walking Nest Spawn Weight", Configuration.CATEGORY_GENERAL, 7, 0, 100, "");
  45.         driderspawnrate = config.getInt("Drider Spawn Weight", Configuration.CATEGORY_GENERAL, 6, 0, 100, "");
  46.        
  47.         hellmultiplier = config.getInt("Hell Multiplier", Configuration.CATEGORY_GENERAL, 2, 1, 3, "The minimum value is 1 and the maximum is 3.");
  48.        
  49.         config.save();
  50.     }
  51.    
  52. }
Advertisement
Add Comment
Please, Sign In to add comment