當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。