当前位置: 首页>>代码示例>>Java>>正文


Java ConfigChangedEvent类代码示例

本文整理汇总了Java中net.minecraftforge.fml.client.event.ConfigChangedEvent的典型用法代码示例。如果您正苦于以下问题:Java ConfigChangedEvent类的具体用法?Java ConfigChangedEvent怎么用?Java ConfigChangedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConfigChangedEvent类属于net.minecraftforge.fml.client.event包,在下文中一共展示了ConfigChangedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
	if (event.getModID().equals(VillagerInventoryMod.MODID))
	{
		if (!event.isWorldRunning() || Minecraft.getMinecraft().isSingleplayer())
		{
			ModConfiguration.syncConfig(false, true);
			if (event.isWorldRunning() && Minecraft.getMinecraft().isSingleplayer())
			{
				VillagerInventoryMod.NETWORK.sendToServer(new ConfigSyncMessage());
			}
		}
	}
}
 
开发者ID:crazysnailboy,项目名称:VillagerInventory,代码行数:17,代码来源:ModConfiguration.java

示例2: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
/**
 * 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(Strings.MODID)) {

		// sync GUI to settings..
		ConfigManager.sync(Strings.MODID, Config.Type.INSTANCE);

		// this also syncs when done
		UniversalRemoteConfiguration.validateConfig();

		int newCapacity = UniversalRemoteConfiguration.fuel.energy.energyCapacity;

		// gotta set it to zero behind the scenes if energy isn't enabled
		if (!UniversalRemoteConfiguration.fuel.fuelType.equals(UniversalRemoteConfiguration.FuelType.Energy.toString()))
		{
			newCapacity = 0;
		}

		// well crap gotta update the registered item now
		ItemRegistry.Items().UniveralRemote.UpdateEnergySettings(
				newCapacity,
				UniversalRemoteConfiguration.fuel.energy.energyReceiveRate,
				0);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:31,代码来源:UniversalRemoteConfiguration.java

示例3: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
	if (event.getModID().equals(ModUncrafting.MODID))
	{
		if (!event.isWorldRunning() || Minecraft.getMinecraft().isSingleplayer())
		{
			syncFromGUI();
			if (event.isWorldRunning() && Minecraft.getMinecraft().isSingleplayer())
			{
				ModUncrafting.NETWORK.sendToServer(new ConfigSyncMessage());
			}
		}
	}
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:17,代码来源:ModConfiguration.java

示例4: onConfigurationChangedEvent

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
	if (event.getModID().equalsIgnoreCase(Reference.MOD_ID)) {
		if (event.getConfigID().equals(Reference.catOptions)) {
			loadConfig();
		} else if (event.getConfigID().equals(Reference.catFullMapConfig)) {
			Config.fullScreenMap.loadConfig();
		} else if (event.getConfigID().equals(Reference.catLargeMapConfig)) {
			Config.largeMap.loadConfig();
		} else if (event.getConfigID().equals(Reference.catSmallMapConfig)) {
			Config.smallMap.loadConfig();
		} else {
			Logging.logError("Unknown config id: %s", event.getConfigID());
		}

		if (configuration.hasChanged()) {
			configuration.save();
		}
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:21,代码来源:ConfigurationHandler.java

示例5: onConfigurationChangedEvent

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@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();
        }
    }
}
 
开发者ID:hancin,项目名称:Fullscreen-Windowed-Minecraft,代码行数:21,代码来源:ConfigurationHandler.java

示例6: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
    if (event.getModID().equals(Names.MOD_ID)) {
        ConfigManager.sync(Names.MOD_ID, Config.Type.INSTANCE);
        PneumaticCraftRepressurized.logger.info("Configuration has been saved.");
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:ConfigHandler.java

示例7: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
/**
 * 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(HardVox.MODID)) {
        if (!validateConfig()) {
            event.setResult(Result.DENY);
            return;
        }
        ConfigManager.sync(HardVox.MODID, Config.Type.INSTANCE);
    }
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:18,代码来源:HardVoxConfig.java

示例8: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs)
{
    if (!CreeperHost.MOD_ID.equals(eventArgs.getModID()))
    {
        return;
    }

    CreeperHost.instance.saveConfig();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:11,代码来源:EventHandler.java

示例9: onConfigChange

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent event)
{
    if (ToolBelt.MODID.equals(event.getModID()))
    {
        if (config.hasChanged())
            config.save();
        refresh();
    }
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:11,代码来源:Config.java

示例10: onConfigChange

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChange(ConfigChangedEvent.OnConfigChangedEvent event) {
    if (event.getModID().equals(FirstAid.MODID)) {
        ConfigManager.sync(FirstAid.MODID, Config.Type.INSTANCE);
        event.setResult(Event.Result.ALLOW);
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:8,代码来源:EventHandler.java

示例11: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event)
{
	if (event.getModID().equals(ModConstants.MODID)) {
		ConfigManager.sync(ModConstants.MODID, Config.Type.INSTANCE);
	}
}
 
开发者ID:Lemonszz,项目名称:Anima-Mundi,代码行数:8,代码来源:AnimaConfig.java

示例12: onConfigurationChangedEvent

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event)
{
    if(event.getModID().equalsIgnoreCase(TheOink.MODID))
        //Resync configs
        syncConfiguration();
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:8,代码来源:OinkConfig.java

示例13: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
{
    if ("authlibloginhelper".equals(event.getModID()))
    {
        AuthlibLoginHelperGuiFactory.Config.onConfigApplied();
    }
}
 
开发者ID:ustc-zzzz,项目名称:AuthlibLoginHelper,代码行数:10,代码来源:AuthlibLoginHelper.java

示例14: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
	// TF2weapons.syncConfig();
	if (eventArgs.getModID().equals("rafradek_spin")) {
		syncConfig();
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:9,代码来源:SpinToWin.java

示例15: onConfigChanged

import net.minecraftforge.fml.client.event.ConfigChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
	// TF2weapons.syncConfig();
	if (eventArgs.getModID().equals("rafradek_tf2_weapons")) {
		TF2ConfigVars.createConfig();
		if(Minecraft.getMinecraft().player != null)
			TF2weapons.network.sendToServer(new TF2Message.InitClientMessage(TF2weapons.conf));
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:10,代码来源:TF2EventsClient.java


注:本文中的net.minecraftforge.fml.client.event.ConfigChangedEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。