Advertisement
Guest User

GuiConfiguration

a guest
Aug 27th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. import mariot7.xlfoodmod.Reference;
  2. import net.minecraftforge.common.config.Config;
  3. import net.minecraftforge.common.config.Config.Comment;
  4. import net.minecraftforge.common.config.ConfigManager;
  5. import net.minecraftforge.fml.client.event.ConfigChangedEvent;
  6. import net.minecraftforge.fml.common.Mod;
  7. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  8.  
  9. @Config(modid = Reference.MOD_ID)
  10. @Config.LangKey("xlfoodmod.config.title")
  11. public class GuiConfigurationxlfoodmod {
  12.    
  13.     @Config.Comment("World Generation Settings")
  14.     public static WorldGen WorldGen = new WorldGen();
  15.    
  16.     public static class WorldGen {
  17.  
  18.         @Config.Comment("Disable the generation of Rock Salt")
  19.         public boolean RockGen = false;
  20.    
  21.         @Config.Comment("Disable the generation of Grass")
  22.         public boolean GrassGen = false;
  23.    
  24.         @Config.Comment("Disable the generation of Vanilla Flowers")
  25.         public boolean FlowerGen = false;
  26.        
  27.     }
  28.  
  29.     @Mod.EventBusSubscriber
  30.     private static class EventHandler {  
  31.         @SubscribeEvent
  32.         public static void configChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
  33.             if (event.getModID().equals(Reference.MOD_ID)) {
  34.                 ConfigManager.sync(Reference.MOD_ID, Config.Type.INSTANCE);
  35.             }
  36.         }
  37.     }  
  38.  
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement