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

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

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

Loader.isModLoaded介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

private static boolean checkIncompatibleMods() {
  if(!checkedIncompatibility) {
    hasIncompatibleMods = Loader.isModLoaded("optifine");
    checkedIncompatibility = true;
  }
  
  return !hasIncompatibleMods;
}

代码示例来源:origin: EngineHub/WorldEdit

@EventHandler
public void serverAboutToStart(FMLServerAboutToStartEvent event) {
  if (this.platform != null) {
    logger.warn("FMLServerStartingEvent occurred when FMLServerStoppingEvent hasn't");
    WorldEdit.getInstance().getPlatformManager().unregister(platform);
  }
  this.platform = new ForgePlatform(this);
  WorldEdit.getInstance().getPlatformManager().register(platform);
  if (Loader.isModLoaded("sponge")) {
    this.provider = new ForgePermissionsProvider.SpongePermissionsProvider();
  } else {
    this.provider = new ForgePermissionsProvider.VanillaPermissionsProvider(platform);
  }
  for (ResourceLocation name : Block.REGISTRY.getKeys()) {
    String nameStr = name.toString();
    if (!BlockType.REGISTRY.keySet().contains(nameStr)) {
      BlockTypes.register(new BlockType(nameStr));
    }
  }
  for (ResourceLocation name : Item.REGISTRY.getKeys()) {
    String nameStr = name.toString();
    if (!ItemType.REGISTRY.keySet().contains(nameStr)) {
      ItemTypes.register(new ItemType(nameStr));
    }
  }
}

代码示例来源:origin: SlimeKnights/TinkersConstruct

public TConstruct() {
 if(Loader.isModLoaded("Natura")) {
  log.info("Natura, what are we going to do tomorrow night?");
  LogManager.getLogger("Natura").info("TConstruct, we're going to take over the world!");
 }
 else {
  log.info("Preparing to take over the world");
 }
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

public static boolean isModLoaded( final String modid )
{
  try
  {
    // if this fails for some reason, try the other method.
    return Loader.isModLoaded( modid );
  }
  catch( final Throwable ignored )
  {
  }
  for( final ModContainer f : Loader.instance().getActiveModList() )
  {
    if( f.getModId().equals( modid ) )
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: Vazkii/Botania

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
  gardenOfGlassLoaded = Loader.isModLoaded("gardenofglass");
  thaumcraftLoaded = Loader.isModLoaded("thaumcraft");
  bcApiLoaded = Loader.isModLoaded("buildcraftlib");
  bloodMagicLoaded = Loader.isModLoaded("bloodmagic"); // Psh, noob
  coloredLightsLoaded = Loader.isModLoaded("easycoloredlights");
  etFuturumLoaded = Loader.isModLoaded("etfuturum");
  BotaniaAPI.internalHandler = new InternalMethodHandler();
  ConfigHandler.loadConfig(event.getSuggestedConfigurationFile());
  PacketHandler.init();
  ModEntities.init();
  ModBrews.init();
  ModMultiblocks.init();
  if(Botania.gardenOfGlassLoaded)
    new WorldTypeSkyblock();
  CriteriaTriggers.register(AlfPortalTrigger.INSTANCE);
  CriteriaTriggers.register(CorporeaRequestTrigger.INSTANCE);
  CriteriaTriggers.register(DopplegangerNoArmorTrigger.INSTANCE);
  CriteriaTriggers.register(RelicBindTrigger.INSTANCE);
  CriteriaTriggers.register(UseItemSuccessTrigger.INSTANCE);
  proxy.preInit(event);
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

if( Loader.isModLoaded( "VersionChecker" ) )

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean isOCEnabled() {
  if(!useCheckPerformed) {
   isOCConduitEnabled = Loader.isModLoaded("opencomputers");
   useCheckPerformed = true;
  }
  return isOCConduitEnabled;
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean isMEEnabled() {
  if (!useCheckPerformed) {
   isMeConduitEnabled = Loader.isModLoaded("appliedenergistics2");
   useCheckPerformed = true;
  }
  return isMeConduitEnabled;
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

private static boolean hasExNihilo() {
 if (hasExNihilo != null) {
  return hasExNihilo;
 }
 return hasExNihilo = Loader.isModLoaded("exnihilocreatio");
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

boolean enabled = this.modID == null || Loader.isModLoaded( this.modID ) || apiManager.hasAPI( this.modID );

代码示例来源:origin: SleepyTrousers/EnderIO

public static void init(@Nonnull FMLPostInitializationEvent event) {
 if (Loader.isModLoaded("cofhcore")) {
  // Add support for TE wrench
  try {
   Class.forName("crazypants.enderio.base.integration.te.TEToolProvider").newInstance();
  } catch (Exception e) {
   Log.warn("Could not find Thermal Expansion Wrench definition. Wrench integration with it may fail");
  }
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean isInSameTeam(@Nonnull UserIdent identA, @Nonnull UserIdent identB) {
 if (Loader.isModLoaded("ftblib")) {
  return isInSameTeamUnsafe(identA, identB);
 }
 return false;
}

代码示例来源:origin: sinkillerj/ProjectE

public static void refreshJEI()
  {
    if (Loader.isModLoaded("jei"))
    {
      PEJeiPlugin.refresh();
    }
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static void create() {
 if (Loader.isModLoaded(MODID_TOP)) {
  FMLInterModComms.sendFunctionMessage(MODID_TOP, "getTheOneProbe", "crazypants.enderio.base.integration.top.TOPCompatibility");
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SubscribeEvent
public static void onPost(EnderIOLifecycleEvent.PostInit.Post event) {
 if (Loader.isModLoaded(MODID_THAUMCRAFT)) {
  ThaumcraftAspects.loadAspects();
 }
}

代码示例来源:origin: Vazkii/Psi

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
  magical = Loader.isModLoaded("magipsi");
  proxy.preInit(event);
}

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

@Override
public boolean preInit() {
  String category = "Plugins";
  String comment = "If TRUE, support for " + modName + " is enabled.";
  enable = ThermalExpansion.CONFIG.getConfiguration().getBoolean(modName, category, true, comment) && Loader.isModLoaded(modId);
  if (!enable) {
    return false;
  }
  preInitDelegate();
  return !error;
}

代码示例来源:origin: lorddusk/HQM

public static void postInit(FMLPostInitializationEvent event, HardcoreQuesting mod){
  if(event.getSide().isClient()){
    if(Loader.isModLoaded(ID_TUMAT)){
      TUMATApi.registerRenderComponent(TumatIntegration.class);
    }
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SubscribeEvent
public static void registerDarkSteelUpgrades(@Nonnull RegistryEvent.Register<IDarkSteelUpgrade> event) {
 if (Loader.isModLoaded(MODID_TOP)) {
  event.getRegistry().register(TheOneProbeUpgrade.getInstance());
  Log.info("Dark Steel Upgrades: TOP integration loaded");
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SubscribeEvent
public static void registerDarkSteelUpgrades(@Nonnull RegistryEvent.Register<IDarkSteelUpgrade> event) {
 if (Loader.isModLoaded(MODID_THAUMCRAFT)) {
  final IForgeRegistry<IDarkSteelUpgrade> registry = event.getRegistry();
  registry.register(ThaumaturgeRobesUpgrade.BOOTS);
  registry.register(ThaumaturgeRobesUpgrade.LEGS);
  registry.register(ThaumaturgeRobesUpgrade.CHEST);
  registry.register(GogglesOfRevealingUpgrade.INSTANCE);
  Log.info("Dark Steel Upgrades: Thaumcraft integration loaded");
 }
}

相关文章