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


Java FMLLog.warning方法代码示例

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


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

示例1: revertToFrozen

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void revertToFrozen()
{
    if (!PersistentRegistry.FROZEN.isPopulated())
    {
        FMLLog.warning("Can't revert to frozen GameData state without freezing first.");
        return;
    }
    else
    {
        FMLLog.fine("Reverting to frozen data state.");
    }
    for (Map.Entry<ResourceLocation, FMLControlledNamespacedRegistry<?>> r : PersistentRegistry.ACTIVE.registries.entrySet())
    {
        final Class<? extends IForgeRegistryEntry> registrySuperType = PersistentRegistry.ACTIVE.getRegistrySuperType(r.getKey());
        loadRegistry(r.getKey(), PersistentRegistry.FROZEN, PersistentRegistry.ACTIVE, registrySuperType);
    }
    // the id mapping has reverted, fire remap events for those that care about id changes
    Loader.instance().fireRemapEvent(ImmutableMap.<ResourceLocation, Integer[]>of(), ImmutableMap.<ResourceLocation, Integer[]>of(), true);

    // the id mapping has reverted, ensure we sync up the object holders
    ObjectHolderRegistry.INSTANCE.applyObjectHolders();
    FMLLog.fine("Frozen state restored.");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:PersistentRegistryManager.java

示例2: dropQueuedChunkLoad

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void dropQueuedChunkLoad(World world, int x, int z, Runnable runnable)
{
    QueuedChunk key = new QueuedChunk(x, z, world);
    ChunkIOProvider task = tasks.get(key);
    if (task == null)
    {
        FMLLog.warning("Attempted to dequeue chunk that wasn't queued? %d @ (%d, %d)", world.provider.getDimension(), x, z);
        return;
    }

    task.removeCallback(runnable);

    if (!task.hasCallback())
    {
        tasks.remove(key);
        pool.remove(task);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:ChunkIOExecutor.java

示例3: requestPlayerTicket

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static Ticket requestPlayerTicket(Object mod, String player, World world, Type type)
{
    ModContainer mc = getContainer(mod);
    if (mc == null)
    {
        FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
        return null;
    }
    if (playerTickets.get(player).size()>playerTicketLength)
    {
        FMLLog.warning("Unable to assign further chunkloading tickets to player %s (on behalf of mod %s)", player, mc.getModId());
        return null;
    }
    Ticket ticket = new Ticket(mc.getModId(),type,world,player);
    playerTickets.put(player, ticket);
    tickets.get(world).put("Forge", ticket);
    return ticket;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:ForgeChunkManager.java

示例4: 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

示例5: setBlock

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public Fluid setBlock(Block block)
{
    if (this.block == null || this.block == block)
    {
        this.block = block;
    }
    else
    {
        FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to the Block "
                + this.block + ". You may have duplicate Fluid Blocks as a result. It *may* be possible to configure your mods to avoid this.");
    }
    return this;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:Fluid.java

示例6: setChunkListDepth

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
 * The chunk list depth can be manipulated up to the maximal grant allowed for the mod. This value is configurable. Once the maximum is reached,
 * the least recently forced chunk, by original registration time, is removed from the forced chunk list.
 *
 * @param depth The new depth to set
 */
public void setChunkListDepth(int depth)
{
    if (depth > getMaxChunkDepthFor(modId) || (depth <= 0 && getMaxChunkDepthFor(modId) > 0))
    {
        FMLLog.warning("The mod %s tried to modify the chunk ticket depth to: %d, its allowed maximum is: %d", modId, depth, getMaxChunkDepthFor(modId));
    }
    else
    {
        this.maxDepth = depth;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:ForgeChunkManager.java

示例7: setForcedChunkLoadingCallback

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
 * Set a chunkloading callback for the supplied mod object
 *
 * @param mod  The mod instance registering the callback
 * @param callback The code to call back when forced chunks are loaded
 */
public static void setForcedChunkLoadingCallback(Object mod, LoadingCallback callback)
{
    ModContainer container = getContainer(mod);
    if (container == null)
    {
        FMLLog.warning("Unable to register a callback for an unknown mod %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
        return;
    }

    callbacks.put(container.getModId(), callback);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:ForgeChunkManager.java

示例8: unloadWorlds

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) {
    for (int id : unloadQueue) {
        WorldServer w = worlds.get(id);
        try {
            if (w != null)
            {
                w.saveAllChunks(true, null);
            }
            else
            {
                FMLLog.warning("Unexpected world unload - world %d is already unloaded", id);
            }
        } catch (MinecraftException e) {
            e.printStackTrace();
        }
        finally
        {
            if (w != null)
            {
                MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
                w.flush();
                setWorld(id, null, w.getMinecraftServer());
            }
        }
    }
    unloadQueue.clear();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:DimensionManager.java

示例9: onEntityJoinWorld

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onEntityJoinWorld(EntityJoinWorldEvent event)
{
    if (!event.getWorld().isRemote)
    {
        ForgeChunkManager.loadEntity(event.getEntity());
    }

    Entity entity = event.getEntity();
    if (entity.getClass().equals(EntityItem.class))
    {
        ItemStack stack = ((EntityItem)entity).getEntityItem();

        if (stack == null)
        {
            //entity.setDead();
            //event.setCanceled(true);
            return;
        }

        Item item = stack.getItem();
        if (item == null)
        {
            FMLLog.warning("Attempted to add a EntityItem to the world with a invalid item at " +
                "(%2.2f,  %2.2f, %2.2f), this is most likely a config issue between you and the server. Please double check your configs",
                entity.posX, entity.posY, entity.posZ);
            entity.setDead();
            event.setCanceled(true);
            return;
        }

        if (item.hasCustomEntity(stack))
        {
            Entity newEntity = item.createEntity(event.getWorld(), entity, stack);
            if (newEntity != null)
            {
                entity.setDead();
                event.setCanceled(true);
                event.getWorld().spawnEntityInWorld(newEntity);
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:ForgeInternalHandler.java

示例10: registerAllBiomes

import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void registerAllBiomes()
{
    FMLLog.warning("Redundant call to BiomeDictionary.registerAllBiomes ignored");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:BiomeDictionary.java


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