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


Java FMLLog.fine方法代码示例

本文整理汇总了Java中cpw.mods.fml.common.FMLLog.fine方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.fine方法的具体用法?Java FMLLog.fine怎么用?Java FMLLog.fine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.common.FMLLog的用法示例。


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

示例1: findClasspathMods

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void findClasspathMods() {
    List<String> knownLibraries = ImmutableList.<String>builder()
            .addAll(modClassLoader.getDefaultLibraries())
            .addAll(CoreModManager.getLoadedCoremods()).build();
    File[] minecraftSources = modClassLoader.getParentSources();
    HashSet<String> searchedSources = new HashSet<String>();
    for (File minecraftSource : minecraftSources) {
        if (searchedSources.contains(minecraftSource.getAbsolutePath()))
            continue;
        searchedSources.add(minecraftSource.getAbsolutePath());

        if (minecraftSource.isFile()) {
            if (!knownLibraries.contains(minecraftSource.getName())) {
                FMLLog.fine("Found a minecraft related file at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
                try {
                    readFromZipFile(minecraftSource);
                } catch (Exception e) {
                    CodeChickenCorePlugin.logger.error("Failed to scan " + minecraftSource.getAbsolutePath() + ", the zip file is invalid", e);
                }
            }
        } else if (minecraftSource.isDirectory()) {
            FMLLog.fine("Found a minecraft related directory at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
            readFromDirectory(minecraftSource, minecraftSource);
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:ClassDiscoverer.java

示例2: testConsistency

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void testConsistency() {
    // test if there's an entry for every set bit in availabilityMap
    for (int i = availabilityMap.nextSetBit(0); i >= 0; i = availabilityMap.nextSetBit(i+1))
    {
        if (iBlockRegistry.getRaw(i) == null && iItemRegistry.getRaw(i) == null && !blockedIds.contains(i))
        {
            throw new IllegalStateException(String.format("availabilityMap references empty entries for id %d.", i));
        }
    }

    for (int pass = 0; pass < 2; pass++)
    {
        boolean isBlock = pass == 0;
        String type = isBlock ? "block" : "item";
        FMLControlledNamespacedRegistry<?> registry = isBlock ? iBlockRegistry : iItemRegistry;
        registry.validateContent((isBlock ? MAX_BLOCK_ID : MAX_ITEM_ID), type, availabilityMap, blockedIds, iBlockRegistry);
    }

    FMLLog.fine("Registry consistency check successful");
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:21,代码来源:GameData.java

示例3: searchZipForLanguages

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void searchZipForLanguages(File source, Side side) throws IOException
{
    ZipFile zf = new ZipFile(source);
    List<String> added = Lists.newArrayList();
    for (ZipEntry ze : Collections.list(zf.entries()))
    {
        Matcher matcher = assetENUSLang.matcher(ze.getName());
        if (matcher.matches())
        {
            String lang = matcher.group(2);
            //FMLLog.fine("Injecting found translation data for lang %s in zip file %s at %s into language system", lang, source.getName(), ze.getName());
            added.add(lang);
            LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(zf.getInputStream(ze)));
            // Ensure en_US is available to StringTranslate on the server
            if ("en_US".equals(lang) && side == Side.SERVER)
            {
                StringTranslate.inject(zf.getInputStream(ze));
            }
        }
    }
    if (added.size() > 0)
        FMLLog.fine("Found translations in %s [%s]", source.getName(), Joiner.on(", ").join(added));
    zf.close();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:25,代码来源:LanguageRegistry.java

示例4: searchDirForLanguages

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void searchDirForLanguages(File source, String path, Side side) throws IOException
{
    for (File file : source.listFiles())
    {
        String currPath = path+file.getName();
        if (file.isDirectory())
        {
            searchDirForLanguages(file, currPath+'/', side);
        }
        Matcher matcher = assetENUSLang.matcher(currPath);
        if (matcher.matches())
        {
            String lang = matcher.group(2);
            FMLLog.fine("Injecting found translation assets for lang %s at %s into language system", lang, currPath);
            LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(new FileInputStream(file)));
            // Ensure en_US is available to StringTranslate on the server
            if ("en_US".equals(lang) && side == Side.SERVER)
            {
                StringTranslate.inject(new FileInputStream(file));
            }
        }
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:24,代码来源:LanguageRegistry.java

示例5: fromBytes

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer)
{
    serverProtocolVersion = buffer.readByte();
    // Extended dimension support during login
    if (serverProtocolVersion > 1)
    {
        overrideDimension = buffer.readInt();
        FMLLog.fine("Server FML protocol version %d, 4 byte dimension received %d", serverProtocolVersion, overrideDimension);
    }
    else
    {
        FMLLog.info("Server FML protocol version %d, no additional data received", serverProtocolVersion);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:16,代码来源:FMLHandshakeMessage.java

示例6: transform

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

    for (MethodNode m: classNode.methods)
    {
        for (ListIterator<AbstractInsnNode> it = m.instructions.iterator(); it.hasNext(); )
        {
            AbstractInsnNode insnNode = it.next();
            if (insnNode.getType() == AbstractInsnNode.FIELD_INSN)
            {
                FieldInsnNode fi = (FieldInsnNode)insnNode;
                if (FLUID_TYPE.equals(fi.owner) && LEGACY_FIELDNAME.equals(fi.name) && fi.getOpcode() == Opcodes.GETFIELD)
                {
                    FMLLog.fine("Method %s.%s%s: Replacing GETFIELD fluidID with INVOKEVIRTUAL getFluidID", name, m.name, m.desc);
                    it.remove();
                    MethodInsnNode replace = new MethodInsnNode(Opcodes.INVOKEVIRTUAL, FLUID_TYPE, GETID_NAME, GETID_DESC, false);
                    it.add(replace);
                }
            }
        }
    }
    ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    classNode.accept(writer);
    return writer.toByteArray();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:31,代码来源:FluidIdTransformer.java

示例7: getPriority

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private static int getPriority(IRecipe recipe)
{
    Class<?> cls = recipe.getClass();
    Integer ret = priorities.get(cls);

    if (ret == null)
    {
        if (!warned.contains(cls))
        {
            FMLLog.info("  Unknown recipe class! %s Modder please refer to %s", cls.getName(), RecipeSorter.class.getName());
            warned.add(cls);
        }
        cls = cls.getSuperclass();
        while (cls != Object.class)
        {
            ret = priorities.get(cls);
            if (ret != null)
            {
                priorities.put(recipe.getClass(), ret);
                FMLLog.fine("    Parent Found: %d - %s", ret.intValue(), cls.getName());
                return ret.intValue();
            }
        }
    }

    return ret == null ? 0 : ret.intValue();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:28,代码来源:RecipeSorter.java

示例8: discover

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table)
{
    this.table = table;
    List<ModContainer> found = Lists.newArrayList();
    FMLLog.fine("Examining directory %s for potential mods", candidate.getModContainer().getName());
    exploreFileSystem("", candidate.getModContainer(), found, candidate, null);
    for (ModContainer mc : found)
    {
        table.addContainer(mc);
    }
    return found;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:14,代码来源:DirectoryDiscoverer.java

示例9: freezeData

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void freezeData()
{
    FMLLog.fine("Freezing block and item id maps");

    getMain().testConsistency();
    frozen = new GameData(getMain());
    frozen.testConsistency();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:9,代码来源:GameData.java

示例10: revertToFrozen

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void revertToFrozen()
{
    if (frozen == null)
    {
        FMLLog.warning("Can't revert to frozen GameData state without freezing first.");
    }
    else
    {
        FMLLog.fine("Reverting to frozen data state.");

        getMain().set(frozen);
    }
    // the id mapping has reverted, ensure we sync up the object holders
    ObjectHolderRegistry.INSTANCE.applyObjectHolders();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:16,代码来源:GameData.java

示例11: registerBlock

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private int registerBlock(Block block, String name, int idHint)
{
    // handle ItemBlock-before-Block registrations
    ItemBlock itemBlock = null;

    for (Item item : iItemRegistry.typeSafeIterable()) // find matching ItemBlock
    {
        if (item instanceof ItemBlock && ((ItemBlock) item).field_150939_a == block)
        {
            itemBlock = (ItemBlock) item;
            break;
        }
    }

    if (itemBlock != null) // has ItemBlock, adjust id and clear the slot already occupied by the corresponding item
    {
        idHint = iItemRegistry.getId(itemBlock);
        FMLLog.fine("Found matching ItemBlock %s for Block %s at id %d", itemBlock, block, idHint);
        freeSlot(idHint, block); // temporarily free the slot occupied by the Item for the block registration
    }

    // add
    int blockId = iBlockRegistry.add(idHint, name, block, availabilityMap);

    if (itemBlock != null) // verify
    {
        if (blockId != idHint) throw new IllegalStateException(String.format("Block at itemblock id %d insertion failed, got id %d.", idHint, blockId));
        verifyItemBlockName(itemBlock);
    }

    useSlot(blockId);
    ((RegistryDelegate.Delegate<Block>) block.delegate).setName(name);
    return blockId;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:35,代码来源:GameData.java

示例12: doModEntityRegistration

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void doModEntityRegistration(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
{
    ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
    EntityRegistration er = new EntityRegistration(mc, entityClass, entityName, id, trackingRange, updateFrequency, sendsVelocityUpdates);
    try
    {
        entityClassRegistrations.put(entityClass, er);
        entityNames.put(entityName, mc);
        if (!EntityList.field_75626_c.containsKey(entityClass))
        {
            String entityModName = String.format("%s.%s", mc.getModId(), entityName);
            EntityList.field_75626_c.put(entityClass, entityModName);
            EntityList.field_75625_b.put(entityModName, entityClass);
            FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName);
        }
        else
        {
            FMLLog.fine("Skipping automatic mod %s entity registration for already registered class %s", mc.getModId(), entityClass.getName());
        }
    }
    catch (IllegalArgumentException e)
    {
        FMLLog.log(Level.WARN, e, "The mod %s tried to register the entity (name,class) (%s,%s) one or both of which are already registered", mc.getModId(), entityName, entityClass.getName());
        return;
    }
    entityRegistrations.put(mc, er);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:29,代码来源:EntityRegistry.java

示例13: sortCraftManager

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static void sortCraftManager()
{
    bake();
    FMLLog.fine("Sorting recipies");
    warned.clear();
    Collections.sort(CraftingManager.func_77594_a().func_77592_b(), INSTANCE);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:9,代码来源:RecipeSorter.java

示例14: loadTexture

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public void loadTexture(IResourceManager p_110551_1_)
{
    try
    {
        if (this.bufferedImage == null && this.textureLocation != null)
        {
            super.loadTexture(p_110551_1_);
        }
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }

    if (this.imageThread == null)
    {
        if (this.field_152434_e != null && this.field_152434_e.isFile())
        {
            FMLLog.fine("Loading http texture from local cache (%s)", this.field_152434_e);

            try
            {
                this.bufferedImage = ImageIO.read(this.field_152434_e);

                if (this.imageBuffer != null)
                {
                    this.setBufferedImage(this.imageBuffer.parseUserSkin(this.bufferedImage));
                }
            }
            catch (IOException ioexception)
            {
                logger.error("Couldn\'t load skin " + this.field_152434_e, ioexception);
                this.func_152433_a();
            }
        }
        else
        {
            this.func_152433_a();
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:42,代码来源:ThreadDownloadImageDataGC.java

示例15: func_152433_a

import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected void func_152433_a()
{
    this.imageThread = new Thread("Texture Downloader #" + threadDownloadCounter.incrementAndGet())
    {
        public void run()
        {
            HttpURLConnection httpurlconnection = null;
            FMLLog.fine("Downloading http texture from %s to %s", ThreadDownloadImageDataGC.this.imageUrl, ThreadDownloadImageDataGC.this.field_152434_e);

            try
            {
                httpurlconnection = (HttpURLConnection) (new URL(ThreadDownloadImageDataGC.this.imageUrl)).openConnection();
                httpurlconnection.setDoInput(true);
                httpurlconnection.setDoOutput(false);
                httpurlconnection.connect();

                if (httpurlconnection.getResponseCode() / 100 == 2)
                {
                    BufferedImage bufferedimage;

                    if (ThreadDownloadImageDataGC.this.field_152434_e != null)
                    {
                        FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageDataGC.this.field_152434_e);
                        bufferedimage = ImageIO.read(ThreadDownloadImageDataGC.this.field_152434_e);
                    }
                    else
                    {
                        bufferedimage = ImageIO.read(httpurlconnection.getInputStream());
                    }

                    if (ThreadDownloadImageDataGC.this.imageBuffer != null)
                    {
                        bufferedimage = ThreadDownloadImageDataGC.this.imageBuffer.parseUserSkin(bufferedimage);
                    }

                    ThreadDownloadImageDataGC.this.setBufferedImage(bufferedimage);
                    return;
                }
            }
            catch (Exception exception)
            {
                ThreadDownloadImageDataGC.logger.error("Couldn\'t download http texture", exception);
                return;
            }
            finally
            {
                if (httpurlconnection != null)
                {
                    httpurlconnection.disconnect();
                }
            }
        }
    };
    this.imageThread.setDaemon(true);
    this.imageThread.start();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:57,代码来源:ThreadDownloadImageDataGC.java


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