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


Java FMLLog.info方法代码示例

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


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

示例1: checkModList

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static String checkModList(Map<String,String> listData, Side side)
{
    List<ModContainer> rejects = Lists.newArrayList();
    for (Entry<ModContainer, NetworkModHolder> networkMod : NetworkRegistry.INSTANCE.registry().entrySet())
    {
        boolean result = networkMod.getValue().check(listData, side);
        if (!result)
        {
            rejects.add(networkMod.getKey());
        }
    }
    if (rejects.isEmpty())
    {
        return null;
    }
    else
    {
        FMLLog.info("Rejecting connection %s: %s", side, rejects);
        return String.format("Mod rejections %s",rejects);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:FMLNetworkHandler.java

示例2: detectOptifine

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private void detectOptifine()
{
    try
    {
        Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
        String optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
        Map<String,Object> dummyOptifineMeta = ImmutableMap.<String,Object>builder().put("name", "Optifine").put("version", optifineVersion).build();
        InputStream optifineModInfoInputStream = getClass().getResourceAsStream("optifinemod.info");
        try
        {
            ModMetadata optifineMetadata = MetadataCollection.from(optifineModInfoInputStream, "optifine").getMetadataForId("optifine", dummyOptifineMeta);
            optifineContainer = new DummyModContainer(optifineMetadata);
            FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features", optifineContainer.getVersion());
        }
        finally
        {
            IOUtils.closeQuietly(optifineModInfoInputStream);
        }
    }
    catch (Exception e)
    {
        optifineContainer = null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:FMLClientHandler.java

示例3: serverToClientHandshake

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public void serverToClientHandshake(EntityPlayerMP player)
{
    this.player = player;
    Boolean fml = this.manager.channel().attr(NetworkRegistry.FML_MARKER).get();
    if (fml != null && fml)
    {
        //FML on client, send server hello
        //TODO: Make this cleaner as it uses netty magic 0.o
        insertIntoChannel();
    }
    else
    {
        serverInitiateHandshake();
        FMLLog.info("Connection received without FML marker, assuming vanilla.");
        this.completeServerSideConnection(ConnectionType.VANILLA);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:NetworkDispatcher.java

示例4: removeRecipe

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
 * Removes all recipes that produce a given item.
 * @param itemToRemove The item whose recipes are to be removed.
 */
private static void removeRecipe(Item itemToRemove) {
    Iterator<IRecipe> iter = CraftingManager.getInstance().getRecipeList().iterator();
    while (iter.hasNext()) {
        IRecipe recipe = iter.next();
        ItemStack out = recipe.getRecipeOutput();
        if (out != ItemStack.EMPTY && out.getItem() == itemToRemove) {
            FMLLog.info("Removing recipe for " + out);
            iter.remove();
        }
    }
}
 
开发者ID:elifoster,项目名称:MakeClayValuableAgain,代码行数:16,代码来源:MakeClayValuableAgain.java

示例5: fromBytes

import net.minecraftforge.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:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:FMLHandshakeMessage.java

示例6: completeClientSideConnection

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private void completeClientSideConnection(ConnectionType type)
{
    this.connectionType = type;
    FMLLog.info("[%s] Client side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
    this.state = ConnectionState.CONNECTED;
    MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ClientConnectedToServerEvent(manager, this.connectionType.name()));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:NetworkDispatcher.java

示例7: explore

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public List<ModContainer> explore(ASMDataTable table)
{
    this.table = table;
    this.mods = sourceType.findMods(this, table);
    if (!baseModCandidateTypes.isEmpty())
    {
        FMLLog.info("Attempting to reparse the mod container %s", getModContainer().getName());
        this.mods = sourceType.findMods(this, table);
    }
    return this.mods;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:ModCandidate.java

示例8: loadIds

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public void loadIds(Map<ResourceLocation, Integer> ids, Map<ResourceLocation, Integer> missingIds, Map<ResourceLocation, Integer[]> remappedIds, FMLControlledNamespacedRegistry<I> currentRegistry, ResourceLocation registryName)
{
    for (Map.Entry<ResourceLocation, Integer> entry : ids.entrySet())
    {
        ResourceLocation itemName = entry.getKey();
        int newId = entry.getValue();
        int currId = currentRegistry.getId(itemName);

        if (currId == -1)
        {
            FMLLog.info("Found a missing id from the world %s", itemName);
            missingIds.put(entry.getKey(), newId);
            continue; // no block/item -> nothing to add
        }
        else if (currId != newId)
        {
            FMLLog.fine("Fixed %s id mismatch %s: %d (init) -> %d (map).", registryName, itemName, currId, newId);
            remappedIds.put(itemName, new Integer[] {currId, newId});
        }
        I obj = currentRegistry.getRaw(itemName);
        I sub = obj;
        // If we have an object in the originals set, we use that for initial adding - substitute activation will readd the substitute if neceessary later
        if (currentRegistry.substitutionOriginals.containsKey(itemName))
        {
            obj = currentRegistry.substitutionOriginals.get(itemName);
        }
        add(newId, itemName, obj);
        if (currentRegistry.substitutionOriginals.containsKey(itemName) && substitutionCallback != null)
        {
            substitutionCallback.onSubstituteActivated(slaves, sub, obj, itemName);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:FMLControlledNamespacedRegistry.java

示例9: setWorld

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void setWorld(int id, WorldServer world, MinecraftServer server)
{
    if (world != null)
    {
        worlds.put(id, world);
        weakWorldMap.put(world, world);
        server.worldTickTimes.put(id, new long[100]);
        FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
    }
    else
    {
        worlds.remove(id);
        server.worldTickTimes.remove(id);
        FMLLog.info("Unloading dimension %d", id);
    }

    ArrayList<WorldServer> tmp = new ArrayList<WorldServer>();
    if (worlds.get( 0) != null)
        tmp.add(worlds.get( 0));
    if (worlds.get(-1) != null)
        tmp.add(worlds.get(-1));
    if (worlds.get( 1) != null)
        tmp.add(worlds.get( 1));

    for (Entry<Integer, WorldServer> entry : worlds.entrySet())
    {
        int dim = entry.getKey();
        if (dim >= -1 && dim <= 1)
        {
            continue;
        }
        tmp.add(entry.getValue());
    }

    server.worldServers = tmp.toArray(new WorldServer[tmp.size()]);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:37,代码来源:DimensionManager.java

示例10: initialize

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
 * Method invoked by FML before any other mods are loaded.
 */
public static void initialize()
{
    FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());

    OreDictionary.getOreName(0);

    UsernameCache.load();
    // Load before all the mods, so MC owns the MC fluids
    FluidRegistry.validateFluidRegistry();
    ForgeHooks.initTools();

    //For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine
    new CrashReport("ThisIsFake", new Exception("Not real"));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:MinecraftForge.java

示例11: queryUser

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
    if (query.getResult() == null)
    {
        FMLLog.warning("%s", query.getText());
        query.finish();
    }
    else
    {
        String text = query.getText() +
                "\n\nRun the command /fml confirm or or /fml cancel to proceed." +
                "\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
        FMLLog.warning("%s", text);

        if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)

        boolean done = false;

        while (!done && server.isServerRunning())
        {
            if (Thread.interrupted()) throw new InterruptedException();

            DedicatedServer dedServer = (DedicatedServer) server;

            // rudimentary command processing, check for fml confirm/cancel and stop commands
            synchronized (dedServer.pendingCommandList)
            {
                for (Iterator<PendingCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, PendingCommand.class).iterator(); it.hasNext(); )
                {
                    String cmd = it.next().command.trim().toLowerCase();

                    if (cmd.equals("/fml confirm"))
                    {
                        FMLLog.info("confirmed");
                        query.setResult(true);
                        done = true;
                        it.remove();
                    }
                    else if (cmd.equals("/fml cancel"))
                    {
                        FMLLog.info("cancelled");
                        query.setResult(false);
                        done = true;
                        it.remove();
                    }
                    else if (cmd.equals("/stop"))
                    {
                        StartupQuery.abort();
                    }
                }
            }

            Thread.sleep(10L);
        }

        query.finish();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:60,代码来源:FMLServerHandler.java

示例12: completeServerSideConnection

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private synchronized void completeServerSideConnection(ConnectionType type)
{
    this.connectionType = type;
    FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH));
    this.state = ConnectionState.CONNECTED;
    MinecraftForge.EVENT_BUS.post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager));
    if (DEBUG_HANDSHAKE)
        manager.closeChannel(new TextComponentString("Handshake Complete review log file for details."));
    scm.initializeConnectionToPlayer(manager, player, serverHandler);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:NetworkDispatcher.java

示例13: handleVanilla

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private boolean handleVanilla(Packet<?> msg)
{
    if (state == ConnectionState.AWAITING_HANDSHAKE && msg instanceof SPacketJoinGame)
    {
        handshakeChannel.pipeline().fireUserEventTriggered(msg);
    }
    else
    {
        FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName());
    }
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:NetworkDispatcher.java

示例14: userEventTriggered

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception
{
    if (evt instanceof ConnectionType && side == Side.SERVER)
    {
        FMLLog.info("Timeout occurred, assuming a vanilla client");
        kickVanilla();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:NetworkDispatcher.java

示例15: testMessageValidity

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
protected void testMessageValidity(FMLProxyPacket msg)
{
    if (msg.payload().getByte(0) == 0 && msg.payload().readableBytes() > 2)
    {
        FMLLog.severe("The connection appears to have sent an invalid FML packet of type 0, this is likely because it think's it's talking to 1.6.4 FML");
        FMLLog.info("Bad data :");
        for (String l : Splitter.on('\n').split(ByteBufUtils.getContentDump(msg.payload()))) {
            FMLLog.info("\t%s",l);
        }
        throw new FMLNetworkException("Invalid FML packet");
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:FMLRuntimeCodec.java


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