Java Code Examples for net.minecraftforge.common.config.ConfigManager#sync()

The following examples show how to use net.minecraftforge.common.config.ConfigManager#sync() . 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: 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 2
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 3
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 4
Source File: Signals.java    From Signals with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void postInit(FMLPostInitializationEvent event){
    proxy.postInit();
    RailManager.getInstance().initializeAPIImplementors(asmData);
    SignalsConfig.client.networkVisualization.initDefaults();
    ConfigManager.sync(Constants.MOD_ID, Type.INSTANCE);
}
 
Example 5
Source File: SignalsConfig.java    From Signals with GNU General Public License v3.0 5 votes vote down vote up
@SubscribeEvent
public static void onConfigChangedEvent(OnConfigChangedEvent event){
    if(event.getModID().equals(Constants.MOD_ID)) {
        ConfigManager.sync(Constants.MOD_ID, Type.INSTANCE);
        if(!enableRailNetwork) {
            Log.warning("RAIL NETWORK IS NOT FUNCTIONAL!");
        }
    }
}
 
Example 6
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 7
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 8
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);
    }
}
 
Example 9
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 10
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 11
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 12
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 13
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 14
Source File: VSConfig.java    From Valkyrien-Skies with Apache License 2.0 4 votes vote down vote up
/**
 * Synchronizes the data in this class and the data in the forge configuration
 */
public static void sync() {
    ConfigManager.sync(ValkyrienSkiesMod.MOD_ID, Type.INSTANCE);

    VSConfig.onSync();
}
 
Example 15
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);
    }
}