Advertisement
Guest User

Method Error

a guest
Oct 31st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. package com.azrael.magus.handler;
  2.  
  3. import java.io.File;
  4.  
  5. import com.azrael.magus.reference.Reference;
  6.  
  7. import cpw.mods.fml.client.event.ConfigChangedEvent;
  8. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  9. import net.minecraftforge.common.config.Configuration;
  10. import net.minecraftforge.common.config.Property;
  11.  
  12. public class ConfigurationHandler {
  13.    
  14.     public static Configuration configuration;
  15.     public static boolean testValue = false;
  16.    
  17.     public static void init(File configFile){
  18.        
  19.         if(configuration == null){
  20.            
  21.          configuration = new Configuration(configFile);
  22.         }
  23.     }
  24.  
  25.  
  26.     @SubscribeEvent
  27.     public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){
  28.        
  29.         if(event.modID.equalsIgnoreCase(Reference.MOD_ID)){
  30.             //resync config file
  31.         }
  32.        
  33.     }
  34.    
  35.     public void loadConfiguration(){
  36.         testValue = Configuration.getBoolean("configValue", Configuration.CATEGORY_GENERAL, false, "example config value");
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement