net.minecraftforge.fml.common.Loader.setActiveModContainer()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中net.minecraftforge.fml.common.Loader.setActiveModContainer()方法的一些代码示例,展示了Loader.setActiveModContainer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Loader.setActiveModContainer()方法的具体详情如下:
包路径:net.minecraftforge.fml.common.Loader
类名称:Loader
方法名:setActiveModContainer

Loader.setActiveModContainer介绍

暂无

代码示例

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

private static void loadFile(ModContainer mod, Path root, Path file, Predicate<IRegistryDataParser> include) {
  Loader.instance().setActiveModContainer(mod);

代码示例来源:origin: CoFH/CoFHCore

public static void register() {
  if (disableAll || registered) {
    return;
  }
  ModContainer callingContainer = Loader.instance().activeModContainer();
  ModContainer cofhContainer = FMLCommonHandler.instance().findContainerFor(CoFHCore.MOD_ID);
  Loader.instance().setActiveModContainer(cofhContainer);
  MinecraftForge.EVENT_BUS.register(INSTANCE);
  registered = true;
  Loader.instance().setActiveModContainer(callingContainer);
}

代码示例来源:origin: CoFH/CoFHCore

public static void register() {
  if (disableAll || registered) {
    return;
  }
  ModContainer callingContainer = Loader.instance().activeModContainer();
  ModContainer cofhContainer = FMLCommonHandler.instance().findContainerFor(CoFHCore.MOD_ID);
  Loader.instance().setActiveModContainer(cofhContainer);
  MinecraftForge.EVENT_BUS.register(INSTANCE);
  registered = true;
  Loader.instance().setActiveModContainer(callingContainer);
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

Loader.instance().setActiveModContainer(mod);

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

public static void loadRecipes() {
  ModContainer awModContainer = Loader.instance().activeModContainer();
  //noinspection ConstantConditions
  loadRecipes(awModContainer, new File(AWCoreStatics.configPathForFiles + "research_recipes"), "");
  Loader.instance().getActiveModList().forEach(m -> AWCraftingManager.loadRecipes(m, m.getSource(), "assets/" + m.getModId() + "/research_recipes"));
  Loader.instance().setActiveModContainer(awModContainer);
}

相关文章