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


Java FMLLog类代码示例

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


FMLLog类属于net.minecraftforge.fml.common包,在下文中一共展示了FMLLog类的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: 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

示例5: bake

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
    builder.put(ModelLoader.White.LOCATION.toString(), ModelLoader.White.INSTANCE);
    TextureAtlasSprite missing = bakedTextureGetter.apply(new ResourceLocation("missingno"));
    for (Map.Entry<String, Material> e : matLib.materials.entrySet())
    {
        if (e.getValue().getTexture().getTextureLocation().getResourcePath().startsWith("#"))
        {
            FMLLog.log.fatal("OBJLoader: Unresolved texture '{}' for obj model '{}'", e.getValue().getTexture().getTextureLocation().getResourcePath(), modelLocation);
            builder.put(e.getKey(), missing);
        }
        else
        {
            builder.put(e.getKey(), bakedTextureGetter.apply(e.getValue().getTexture().getTextureLocation()));
        }
    }
    builder.put("missingno", missing);
    return new TintedOBJBakedModel(this, state, format, builder.build());
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:22,代码来源:TintedOBJModel.java

示例6: shutupForge

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
/**
 * Make forge not spew "dangerous alternative prefix" messages in this block.
 */
public static void shutupForge(Runnable op) {
    Logger log = (Logger) FMLLog.log;
    try {
        Object privateConfig = ReflectionHelper.findField(Logger.class, "privateConfig").get(log);
        Field intLevelF = ReflectionHelper.findField(privateConfig.getClass(), "intLevel");
        int intLevel = (int) intLevelF.get(privateConfig);
        intLevelF.set(privateConfig, 299); // disable WARN logging

        try {
            op.run();
        } finally {
            intLevelF.set(privateConfig, intLevel);
        }
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:21,代码来源:Nope.java

示例7: bake

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    IBakedModel bakedBase = null;

    if (base != null)
        bakedBase = base.bake(state, format, bakedTextureGetter);

    ImmutableMap.Builder<String, IBakedModel> mapBuilder = ImmutableMap.builder();

    for (Entry<String, Pair<IModel, IModelState>> entry : parts.entrySet())
    {
        Pair<IModel, IModelState> pair = entry.getValue();
        mapBuilder.put(entry.getKey(), pair.getLeft().bake(new ModelStateComposition(state, pair.getRight()), format, bakedTextureGetter));
    }

    if(bakedBase == null && parts.isEmpty())
    {
        FMLLog.log(Level.ERROR, "MultiModel %s is empty (no base model or parts were provided/resolved)", location);
        IModel missing = ModelLoaderRegistry.getMissingModel();
        return missing.bake(missing.getDefaultState(), format, bakedTextureGetter);
    }
    return new Baked(location, true, bakedBase, mapBuilder.build());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:MultiModel.java

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

示例9: getInputStreamByName

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
protected InputStream getInputStreamByName(String resourceName) throws IOException
{
    try
    {
        return super.getInputStreamByName(resourceName);
    }
    catch (IOException ioe)
    {
        if ("pack.mcmeta".equals(resourceName))
        {
            FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName());
            return new ByteArrayInputStream(("{\n" +
                    " \"pack\": {\n"+
                    "   \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+
                    "   \"pack_format\": 1\n"+
                    "}\n" +
                    "}").getBytes(Charsets.UTF_8));
        }
        else throw ioe;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:FMLFileResourcePack.java

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

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

示例12: exceptionCaught

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
    // Stop the epic channel closed spam at close
    if (!(cause instanceof ClosedChannelException))
    {
        // Mute the reset by peer exception - it's disconnection noise
        if (cause.getMessage().contains("Connection reset by peer"))
        {
            FMLLog.log(Level.DEBUG, cause, "Muted NetworkDispatcher exception");
        }
        else
        {
            FMLLog.log(Level.ERROR, cause, "NetworkDispatcher exception");
        }
    }
    super.exceptionCaught(ctx, cause);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:NetworkDispatcher.java

示例13: bake

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
    ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
    builder.put(ModelLoader.White.LOCATION.toString(), ModelLoader.White.INSTANCE);
    TextureAtlasSprite missing = bakedTextureGetter.apply(new ResourceLocation("missingno"));
    for (Map.Entry<String, Material> e : matLib.materials.entrySet())
    {
        if (e.getValue().getTexture().getTextureLocation().getResourcePath().startsWith("#"))
        {
            FMLLog.severe("OBJLoader: Unresolved texture '%s' for obj model '%s'", e.getValue().getTexture().getTextureLocation().getResourcePath(), modelLocation);
            builder.put(e.getKey(), missing);
        }
        else
        {
            builder.put(e.getKey(), bakedTextureGetter.apply(e.getValue().getTexture().getTextureLocation()));
        }
    }
    builder.put("missingno", missing);
    return new OBJBakedModel(this, state, format, builder.build());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:OBJModel.java

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

示例15: decode

import net.minecraftforge.fml.common.FMLLog; //导入依赖的package包/类
@Override
protected final void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception
{
    testMessageValidity(msg);
    ByteBuf payload = msg.payload().duplicate();
    if (payload.readableBytes() < 1)
    {
        FMLLog.log(Level.ERROR, "The FMLIndexedCodec has received an empty buffer on channel %s, likely a result of a LAN server issue. Pipeline parts : %s", ctx.channel().attr(NetworkRegistry.FML_CHANNEL), ctx.pipeline().toString());
    }
    byte discriminator = payload.readByte();
    Class<? extends A> clazz = discriminators.get(discriminator);
    if(clazz == null)
    {
        throw new NullPointerException("Undefined message for discriminator " + discriminator + " in channel " + msg.channel());
    }
    A newMsg = clazz.newInstance();
    ctx.attr(INBOUNDPACKETTRACKER).get().set(new WeakReference<FMLProxyPacket>(msg));
    decodeInto(ctx, payload.slice(), newMsg);
    out.add(newMsg);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:FMLIndexedMessageToMessageCodec.java


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