net.minecraftforge.fml.client.event.ConfigChangedEvent Java Examples

The following examples show how to use net.minecraftforge.fml.client.event.ConfigChangedEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConfigurationHandler.java    From Fullscreen-Windowed-Minecraft with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{
    try {
        if (event.getModID().equalsIgnoreCase(Reference.MOD_ID)) {
            load();
            if (!_isInitializing) {
                FullscreenWindowed.proxy.registerKeyBindings();
            }
        }
    } catch (java.lang.NoSuchMethodError e) {
        // In earlier versions of Forge (1.8), event.getModID() does not exist.
        // While this means any config change in any 1.8 mod configuration will force a reload of our configuration,
        // this is probably better than crashing...
        load();
        if (!_isInitializing) {
            FullscreenWindowed.proxy.registerKeyBindings();
        }
    }
}
 
Example #2
Source File: EmergingTechnologyConfig.java    From EmergingTechnology with MIT License 5 votes vote down vote up
/**
 * Inject the new values and save to the config file when the config has been changed from the GUI.
 *
 * @param event The event
 */
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
	if (event.getModID().equals(EmergingTechnology.MODID)) {
		ConfigManager.sync(EmergingTechnology.MODID, Config.Type.INSTANCE);
	}
}
 
Example #3
Source File: I18nConfig.java    From I18nUpdateMod with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(I18nUpdateMod.MODID)) {
        ConfigManager.sync(I18nUpdateMod.MODID, Config.Type.INSTANCE);
        I18nUpdateMod.logger.info("配置文件修改已经保存");
    }
}
 
Example #4
Source File: BakaDanmakuConfig.java    From BakaDanmaku with MIT License 5 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(BakaDanmaku.MOD_ID)) {
        // 重载配置
        ConfigManager.sync(BakaDanmaku.MOD_ID, Config.Type.INSTANCE);

        if (BakaDanmaku.player != null) {
            // 提示信息
            BaseDanmakuThread.sendChatMessage("§8§l配置已经保存,正在重启中……");

            // 重载房间信息
            DanmakuThreadFactory.restartThreads();
        }
    }
}
 
Example #5
Source File: ModProvider.java    From AgriCraft with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(Reference.MOD_ID)) {
        AgriCore.getConfig().save();
        AgriCore.getConfig().load();
        AgriCore.getLogger("agricraft").debug("Configuration reloaded.");
    }
}
 
Example #6
Source File: CraftingKeys.java    From CraftingKeys with MIT License 5 votes vote down vote up
/**
 * This method will be executed when the Config is changed. Update!
 *
 * @param eventArgs Input event from FML
 */
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
    if (eventArgs.getModID().equals(MODID)) { 
        Config.syncConfig();
        Logger.info("onConfigChanged(e)", "Changed config.");
    }
}
 
Example #7
Source File: CommonHandler.java    From GokiStats with MIT License 5 votes vote down vote up
@SubscribeEvent
public void configChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(Reference.MODID)) {
        ConfigManager.sync(Reference.MODID, Config.Type.INSTANCE);
        LootConfigDeserializer.reloadAll();
    }
}
 
Example #8
Source File: CyberwareConfig.java    From Cyberware with MIT License 5 votes vote down vote up
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{
	if (event.getModID().equalsIgnoreCase(Cyberware.MODID))
	{
		loadConfig();
	}
}
 
Example #9
Source File: ToroQuestConfiguration.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
	if (event.getModID().equalsIgnoreCase(ToroQuest.MODID)) {
		loadConfiguration();
	}
}
 
Example #10
Source File: HoloInventory.java    From HoloInventory with MIT License 4 votes vote down vote up
@SubscribeEvent
public void updateConfig(ConfigChangedEvent.OnConfigChangedEvent event)
{
    if (event.getModID().equals(MODID)) updateConfig();
}
 
Example #11
Source File: ConfigStorage.java    From OpenModsLib with MIT License 4 votes vote down vote up
@SubscribeEvent
public void onConfigChange(ConfigChangedEvent.PostConfigChangedEvent evt) {
	saveAll(evt.getModID());
}
 
Example #12
Source File: ConfigHandler.java    From VersionChecker with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
    if(eventArgs.getModID().equals(Reference.MOD_ID))
        ConfigHandler.syncConfig();
}
 
Example #13
Source File: ConfigurationHandler.java    From LunatriusCore with MIT License 4 votes vote down vote up
@SubscribeEvent
public void onConfigurationChangedEvent(final ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equalsIgnoreCase(Reference.MODID)) {
        ConfigManager.sync(Reference.MODID, Config.Type.INSTANCE);
    }
}
 
Example #14
Source File: ConfigurationHandler.java    From Moo-Fluids with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void onConfigurationChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
  if (event.getModID().equalsIgnoreCase(ModInformation.MOD_ID)) {
    updateConfiguration();
  }
}
 
Example #15
Source File: VSConfig.java    From Valkyrien-Skies with Apache License 2.0 4 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(ValkyrienSkiesMod.MOD_ID)) {
        sync();
    }
}
 
Example #16
Source File: TofuConfig.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(TofuMain.MODID)) {
        ConfigManager.sync(TofuMain.MODID, Config.Type.INSTANCE);
    }
}
 
Example #17
Source File: ConfigurationHandler.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigChangeEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
	if (event.getModID().equalsIgnoreCase(ToroQuest.MODID)) {
		loadConfiguration();
	}
}
 
Example #18
Source File: SoundPhysicsCore.java    From Sound-Physics with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
{
	if (eventArgs.getModID().equals(modid))
		syncConfig();
}
 
Example #19
Source File: ModConfig.java    From VanillaFix with MIT License 4 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals("vanillafix")) {
        ConfigManager.sync(event.getModID(), Type.INSTANCE);
    }
}
 
Example #20
Source File: CommonProxy.java    From YouTubeModdingTutorial with MIT License 4 votes vote down vote up
@SubscribeEvent
public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(MODID)) {
        ConfigManager.sync(MODID, Config.Type.INSTANCE);
    }
}
 
Example #21
Source File: GTMod.java    From GT-Classic with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
	if (event.getModID().equals(MODID)) {
		ConfigManager.sync(MODID, Config.Type.INSTANCE);
	}
}
 
Example #22
Source File: CommonProxy.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public static void syncConfigValues(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(GTValues.MODID)) {
        ConfigManager.sync(GTValues.MODID, Type.INSTANCE);
    }
}
 
Example #23
Source File: EventHandlers.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(GTValues.MODID)) {
        ConfigManager.sync(GTValues.MODID, Config.Type.INSTANCE);
    }
}
 
Example #24
Source File: SakuraConfig.java    From Sakura_mod with MIT License 4 votes vote down vote up
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(SakuraMain.MODID)) {
        ConfigManager.sync(SakuraMain.MODID, Config.Type.INSTANCE);
    }
}