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


Java ConfigFileChangedEvent类代码示例

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


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

示例1: processCommand

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender player, String[] args) {
  if (side == Side.CLIENT == player.getEntityWorld().isRemote)
    for (String s : args) {
      boolean validModid = false;
      for (ModContainer mod : Loader.instance().getModObjectList().keySet()) {
        if (mod.getModId().equals(s)) {
          validModid = true;
        }
      }

      if (validModid) {
        ConfigFileChangedEvent event = new ConfigFileChangedEvent(s);
        FMLCommonHandler.instance().bus().post(event);

        if (event.isSuccessful()) {
          sendResult(player, s, "success");
        } else {
          sendResult(player, s, "fail");
        }
      } else {
        sendResult(player, s, "invalid");
      }
    }
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:26,代码来源:CommandReloadConfigs.java

示例2: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.modID.equals(modid)) {
    EnderCore.logger.info("Reloading ingame configs for modid: " + modid);
    loadConfigFile();
    reloadIngameConfigs();
    event.setSuccessful();
    saveConfigFile();
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:11,代码来源:AbstractConfigHandler.java

示例3: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SuppressWarnings("static-method")
@SubscribeEvent
public void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.modID.equals(EnderIOAddons.MODID)) {
    Log.info("Updating config...");
    syncConfig(true);
    event.setSuccessful();
  }
}
 
开发者ID:HenryLoenwind,项目名称:EnderIOAddons,代码行数:10,代码来源:ConfigHandler.java

示例4: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.getModID().equals(EnderIOMachines.MODID)) {
    Log.info("Updating config...");
    syncConfig(true);
    event.setSuccessful();
    init((FMLInitializationEvent) null);
    init((FMLPostInitializationEvent) null);
    // TODO: if this is a server we should re-send the config sync packet to all connected players
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:12,代码来源:ConfigHandler.java

示例5: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.getModID().equals(EnderIOPowerTools.MODID)) {
    Log.info("Updating config...");
    syncConfig(true);
    event.setSuccessful();
    init((FMLInitializationEvent) null);
    init((FMLPostInitializationEvent) null);
    // TODO: if this is a server we should re-send the config sync packet to all connected players
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:12,代码来源:ConfigHandler.java

示例6: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.getModID().equals(EnderIOConduits.MODID)) {
    Log.info("Updating config...");
    syncConfig(true);
    event.setSuccessful();
    init((FMLInitializationEvent) null);
    init((FMLPostInitializationEvent) null);
    // TODO: if this is a server we should re-send the config sync packet to all connected players
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:12,代码来源:ConfigHandler.java

示例7: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.getModID().equals(EnderIO.MODID)) {
    Log.info("Updating config...");
    syncConfig(true);
    event.setSuccessful();
    init((FMLInitializationEvent) null);
    init((FMLPostInitializationEvent) null);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:11,代码来源:Config.java

示例8: onConfigFileChanged

import com.enderio.core.common.event.ConfigFileChangedEvent; //导入依赖的package包/类
@SubscribeEvent
public void onConfigFileChanged(ConfigFileChangedEvent event) {
  if (event.modID.equals(modid)) {
    process(true);
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderCore,代码行数:7,代码来源:ConfigProcessor.java


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