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


Java ModAPIManager类代码示例

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


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

示例1: hasUsableWrench

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
/**
 * Returns true if the player has a usable wrench equipped.
 */
public static boolean hasUsableWrench(EntityPlayer pPlayer, int pX, int pY, int pZ) {
    ItemStack tool = pPlayer.getCurrentEquippedItem();
    if (tool != null) {
        if (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool.getItem() instanceof IToolWrench && ((IToolWrench) tool.getItem())
                .canWrench(pPlayer, pX, pY, pZ)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:Nauktis,项目名称:SolarFlux,代码行数:14,代码来源:Utils.java

示例2: init

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
public static void init() {
    IS_IRON_CHEST_LOADED = Loader.isModLoaded(IRON_CHEST_ID);
    IS_JABBA_LOADED = Loader.isModLoaded(JABBA_ID);
    IS_EE3_LOADED = Loader.isModLoaded(EE3_ID);
    IS_BC_TRANSPORT_API_LOADED = ModAPIManager.INSTANCE.hasAPI(BC_TRANS_API_ID);
    IS_COFH_TRANSPORT_API_LOADED = ModAPIManager.INSTANCE.hasAPI(COFH_TRANSPORT_API_ID);
    IS_COFH_ENERGY_API_LOADED = ModAPIManager.INSTANCE.hasAPI(COFH_ENERGY_API_ID);
    IS_IC2_LOADED = Loader.isModLoaded(IC2_ID);
    IS_FMP_LOADED = !Settings.FORCE_NON_FMP_RELOCATORS && Loader.isModLoaded(FMP_ID);
    IS_WAILA_LOADED = Loader.isModLoaded(WAILA_ID);
    IS_AE2_LOADED = Loader.isModLoaded(AE2_ID);
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:13,代码来源:Mods.java

示例3: ModSorter

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
public ModSorter(List<ModContainer> modList, Map<String, ModContainer> nameLookup)
{
    HashMap<String, ModContainer> sortingNameLookup = Maps.newHashMap(nameLookup);
    ModAPIManager.INSTANCE.injectAPIModContainers(modList, sortingNameLookup);
    buildGraph(modList, sortingNameLookup);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:ModSorter.java

示例4: transform

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass)
{
    String lookupName = name;
    if(name.endsWith("$class"))
    {
        lookupName = name.substring(0, name.length() - 6);
    }
    if (optionals == null || !optionals.containsKey(lookupName))
    {
        return basicClass;
    }
    ClassNode classNode = new ClassNode();
    ClassReader classReader = new ClassReader(basicClass);
    classReader.accept(classNode, 0);

    if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - found optionals for class %s - processing", name);
    for (ASMData optional : optionals.get(lookupName))
    {
        String modId = (String) optional.getAnnotationInfo().get("modid");

        if (Loader.isModLoaded(modId) || ModAPIManager.INSTANCE.hasAPI(modId))
        {
            if (logDebugInfo) FMLRelaunchLog.finer("Optional removal skipped - mod present %s", modId);
            continue;
        }
        if (logDebugInfo) FMLRelaunchLog.finer("Optional on %s triggered - mod missing %s", name, modId);

        if (optional.getAnnotationInfo().containsKey("iface"))
        {
            Boolean stripRefs = (Boolean)optional.getAnnotationInfo().get("striprefs");
            if (stripRefs == null) stripRefs = Boolean.FALSE;
            stripInterface(classNode,(String)optional.getAnnotationInfo().get("iface"), stripRefs);
        }
        else
        {
            stripMethod(classNode, (String)optional.getObjectName());
        }

    }
    if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - class %s processed", name);

    ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    classNode.accept(writer);
    return writer.toByteArray();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:47,代码来源:ModAPITransformer.java

示例5: BCPresent

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
public static boolean BCPresent()
{
	return ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|fuels") && MekanismUtils.classExists("buildcraft.api.fuels.BuildcraftFuelRegistry") && MekanismUtils.classExists("buildcraft.api.fuels.IFuel");
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:5,代码来源:FuelHandler.java

示例6: register

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
public static void register() {
  MinecraftForge.EVENT_BUS.register(instance);
  for (ModContainer modContainer : ModAPIManager.INSTANCE.getAPIList()) {
    Log.info(modContainer.getModId() + " version " + modContainer.getVersion() + " from " + modContainer.getSource().getName());
  }
}
 
开发者ID:HenryLoenwind,项目名称:EnderIOAddons,代码行数:7,代码来源:InfiniteWaterSourceStopper.java

示例7: canLoad

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public boolean canLoad() {
	final String apiId = getApiId();
	return ModAPIManager.INSTANCE.hasAPI(apiId);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:6,代码来源:ApiIntegrationModule.java

示例8: transform

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass)
{
    if (optionals == null || !optionals.containsKey(name))
    {
        return basicClass;
    }
    ClassNode classNode = new ClassNode();
    ClassReader classReader = new ClassReader(basicClass);
    classReader.accept(classNode, 0);

    if (logDebugInfo) FMLRelaunchLog.finest("Optional removal - found optionals for class %s - processing", name);
    for (ASMData optional : optionals.get(name))
    {
        String modId = (String) optional.getAnnotationInfo().get("modid");

        if (Loader.isModLoaded(modId) || ModAPIManager.INSTANCE.hasAPI(modId))
        {
            if (logDebugInfo) FMLRelaunchLog.finest("Optional removal skipped - mod present %s", modId);
            continue;
        }
        if (logDebugInfo) FMLRelaunchLog.finest("Optional on %s triggered - mod missing %s", name, modId);

        if (optional.getAnnotationInfo().containsKey("iface"))
        {
            Boolean stripRefs = (Boolean)optional.getAnnotationInfo().get("striprefs");
            if (stripRefs == null) stripRefs = Boolean.FALSE;
            stripInterface(classNode,(String)optional.getAnnotationInfo().get("iface"), stripRefs);
        }
        else
        {
            stripMethod(classNode, (String)optional.getObjectName());
        }

    }
    if (logDebugInfo) FMLRelaunchLog.finest("Optional removal - class %s processed", name);

    ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    classNode.accept(writer);
    return writer.toByteArray();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:42,代码来源:ModAPITransformer.java

示例9: hasWrench

import cpw.mods.fml.common.ModAPIManager; //导入依赖的package包/类
/**
 * Checks if the player is currently wielding a Buildcraft-compatible wrench
 * @param pPlayer Player who might be holding the wrench
 * @param pX X coordinate of the position trying to be wrenched
 * @param pY Y coordinate of the position trying to be wrenched
 * @param pZ Z coordinate of the position trying to be wrenched
 * @return {@code true} if the player can wrench and {@code false} otherwise
 */
public static boolean hasWrench(EntityPlayer pPlayer, int pX, int pY, int pZ) {
    ItemStack tool = pPlayer.getCurrentEquippedItem();
    return tool != null && (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") &&
                (tool.getItem() instanceof IToolWrench) &&
                ((IToolWrench)tool.getItem()).canWrench(pPlayer, pX, pY, pZ));
}
 
开发者ID:dbMansfield,项目名称:rfwindmill,代码行数:15,代码来源:Util.java


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