Java Code Examples for cpw.mods.fml.common.FMLLog#log()

The following examples show how to use cpw.mods.fml.common.FMLLog#log() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThermosClassTransformer.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void transform(final ImagineASM asm) {
    if (asm.is("climateControl.utils.ChunkGeneratorExtractor")) {
        boolean undergroundBiomesInstalled = false;
        try {
            Class.forName("exterminatorJeff.undergroundBiomes.worldGen.ChunkProviderWrapper");
            undergroundBiomesInstalled = true;
        } catch (Exception ignored) {
        }
        if (!undergroundBiomesInstalled) {
            FMLLog.log(Level.INFO, "Thermos: Patching " + asm.getActualName() + " for compatibility with Climate Control");
            extractFrom(asm, asm.method("extractFrom",
                    "(Lnet/minecraft/world/WorldServer;)Lnet/minecraft/world/chunk/IChunkProvider;").instructions());
        }
    }
}
 
Example 2
Source File: TrackRegistry.java    From NEI-Integration with MIT License 6 votes vote down vote up
/**
 * Returns a cached copy of a TrackSpec object.
 *
 * @param trackId
 * @return
 */
public static TrackSpec getTrackSpec(int trackId) {
    Short id = (short) trackId;
    TrackSpec spec = trackSpecsFromID.get(id);
    if (spec == null) {
        if (!invalidSpecIDs.contains(id)) {
            FMLLog.log("Railcraft", Level.WARN, "Unknown Track Spec ID(%d), reverting to normal track", trackId);
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            for (int i = 1; i < stackTrace.length && i < 9; i++) {
                FMLLog.log(Level.DEBUG, stackTrace[i].toString());
            }
            invalidSpecIDs.add(id);
        }
        id = -1;
        spec = trackSpecsFromID.get(id);
    }
    return spec;
}
 
Example 3
Source File: TrackRegistry.java    From NEI-Integration with MIT License 6 votes vote down vote up
/**
 * Returns a cached copy of a TrackSpec object.
 *
 * @param trackTag
 * @return
 */
public static TrackSpec getTrackSpec(String trackTag) {
    trackTag = trackTag.toLowerCase(Locale.ENGLISH);
    TrackSpec spec = trackSpecsFromTag.get(trackTag);
    if (spec == null) {
        if (!invalidSpecTags.contains(trackTag)) {
            FMLLog.log("Railcraft", Level.WARN, "Unknown Track Spec Tag(%s), reverting to normal track", trackTag);
            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
            for (int i = 1; i < stackTrace.length && i < 9; i++) {
                FMLLog.log(Level.DEBUG, stackTrace[i].toString());
            }
            invalidSpecTags.add(trackTag);
        }
        spec = trackSpecsFromTag.get("railcraft:default");
    }
    return spec;
}
 
Example 4
Source File: IntegrationRegistry.java    From GardenCollection with MIT License 6 votes vote down vote up
public void init () {
    for (int i = 0; i < registry.size(); i++) {
        IntegrationModule module = registry.get(i);
        if (module.getModID() != null && !Loader.isModLoaded(module.getModID())) {
            registry.remove(i--);
            continue;
        }

        try {
            module.init();
        }
        catch (Throwable t) {
            registry.remove(i--);
            FMLLog.log(GardenStuff.MOD_ID, Level.INFO, "Could not load integration module: " + module.getClass().getName() + " (init)");
        }
    }
}
 
Example 5
Source File: ResearchCategories.java    From GardenCollection with MIT License 5 votes vote down vote up
public static void addResearch(ResearchItem ri) {
	ResearchCategoryList rl = getResearchList(ri.category);
	if (rl!=null && !rl.research.containsKey(ri.key)) {
		
		if (!ri.isVirtual()) {
			for (ResearchItem rr:rl.research.values()) {
				if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) {
					FMLLog.log(Level.FATAL, "[Thaumcraft] Research ["+ri.getName()+"] not added as it overlaps with existing research ["+rr.getName()+"]");
					return;
				}
			}
		}
		
		
		rl.research.put(ri.key, ri);
		
		if (ri.displayColumn < rl.minDisplayColumn) 
        {
            rl.minDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow < rl.minDisplayRow)
        {
            rl.minDisplayRow = ri.displayRow;
        }

        if (ri.displayColumn > rl.maxDisplayColumn)
        {
            rl.maxDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow > rl.maxDisplayRow)
        {
            rl.maxDisplayRow = ri.displayRow;
        }
        		}
}
 
Example 6
Source File: ResearchCategories.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
public static void addResearch(ResearchItem ri) {
	ResearchCategoryList rl = getResearchList(ri.category);
	if (rl!=null && !rl.research.containsKey(ri.key)) {
		
		if (!ri.isVirtual()) {
			for (ResearchItem rr:rl.research.values()) {
				if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) {
					FMLLog.log(Level.FATAL, "[Thaumcraft] Research ["+ri.getName()+"] not added as it overlaps with existing research ["+rr.getName()+"]");
					return;
				}
			}
		}
		
		
		rl.research.put(ri.key, ri);
		
		if (ri.displayColumn < rl.minDisplayColumn) 
        {
            rl.minDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow < rl.minDisplayRow)
        {
            rl.minDisplayRow = ri.displayRow;
        }

        if (ri.displayColumn > rl.maxDisplayColumn)
        {
            rl.maxDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow > rl.maxDisplayRow)
        {
            rl.maxDisplayRow = ri.displayRow;
        }
        		}
}
 
Example 7
Source File: BloodMagic.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
private static void aspectBloodItem(String target, int damage, AspectList list) {
    try {
        Item item = Compat.getItem("AWWayofTime", target);
        ThaumcraftApi.registerObjectTag(new ItemStack(item, 1, damage), list);
    } catch (Exception e) {
        FMLLog.log(Level.INFO, e, "Forbidden Magic was unable to add aspects to " + target);
    }
}
 
Example 8
Source File: IntegrationRegistry.java    From GardenCollection with MIT License 5 votes vote down vote up
public void postInit () {
    for (int i = 0; i < registry.size(); i++) {
        IntegrationModule module = registry.get(i);

        try {
            module.postInit();
        }
        catch (Throwable t) {
            registry.remove(i--);
            FMLLog.log(GardenStuff.MOD_ID, Level.INFO, "Could not load integration module: " + module.getClass().getName() + " (post-init)");
        }
    }
}
 
Example 9
Source File: ModBlocks.java    From GardenCollection with MIT License 5 votes vote down vote up
public static UniqueMetaIdentifier getUniqueMetaID (Block block, int meta) {
    String name = GameData.getBlockRegistry().getNameForObject(block);
    if (name == null) {
        FMLLog.log(GardenCore.MOD_ID, Level.WARN, "Tried to make a UniqueMetaIdentifier from an invalid block");
        return null;
    }

    return new UniqueMetaIdentifier(name, meta);
}
 
Example 10
Source File: ModBlocks.java    From GardenCollection with MIT License 5 votes vote down vote up
public static UniqueMetaIdentifier getUniqueMetaID (Block block, int meta) {
    String name = GameData.getBlockRegistry().getNameForObject(block);
    if (name == null) {
        FMLLog.log(GardenContainers.MOD_ID, Level.WARN, "Tried to make a UniqueMetaIdentifier from an invalid block");
        return null;
    }

    return new UniqueMetaIdentifier(name, meta);
}
 
Example 11
Source File: ModBlocks.java    From GardenCollection with MIT License 5 votes vote down vote up
public static UniqueMetaIdentifier getUniqueMetaID (Block block, int meta) {
    String name = GameData.getBlockRegistry().getNameForObject(block);
    if (name == null) {
        FMLLog.log(GardenTrees.MOD_ID, Level.WARN, "Tried to make a UniqueMetaIdentifier from an invalid block");
        return null;
    }

    return new UniqueMetaIdentifier(name, meta);
}
 
Example 12
Source File: LanternSourceRegistry.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public void registerLanternSource (ILanternSource lanternSource) {
    if (lanternSource == null)
        return;

    if (registry.containsKey(lanternSource.getSourceID())) {
        FMLLog.log("GardenStuff", Level.ERROR, "Key '%s' already registered as a lantern source.");
        return;
    }

    registry.put(lanternSource.getSourceID(), lanternSource);
}
 
Example 13
Source File: ResearchCategories.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
public static void addResearch(ResearchItem ri) {
	ResearchCategoryList rl = getResearchList(ri.category);
	if (rl!=null && !rl.research.containsKey(ri.key)) {
		
		if (!ri.isVirtual()) {
			for (ResearchItem rr:rl.research.values()) {
				if (rr.displayColumn == ri.displayColumn && rr.displayRow == ri.displayRow) {
					FMLLog.log(Level.FATAL, "[Thaumcraft] Research ["+ri.getName()+"] not added as it overlaps with existing research ["+rr.getName()+"]");
					return;
				}
			}
		}
		
		
		rl.research.put(ri.key, ri);
		
		if (ri.displayColumn < rl.minDisplayColumn) 
        {
            rl.minDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow < rl.minDisplayRow)
        {
            rl.minDisplayRow = ri.displayRow;
        }

        if (ri.displayColumn > rl.maxDisplayColumn)
        {
            rl.maxDisplayColumn = ri.displayColumn;
        }

        if (ri.displayRow > rl.maxDisplayRow)
        {
            rl.maxDisplayRow = ri.displayRow;
        }
        		}
}
 
Example 14
Source File: FuelManager.java    From NEI-Integration with MIT License 5 votes vote down vote up
/**
 * Register the amount of heat in a bucket of liquid fuel.
 *
 * @param fluid
 * @param heatValuePerBucket
 */
public static void addBoilerFuel(Fluid fluid, int heatValuePerBucket) {
    ModContainer mod = Loader.instance().activeModContainer();
    String modName = mod != null ? mod.getName() : "An Unknown Mod";
    if (fluid == null) {
        FMLLog.log("Railcraft", Level.WARN, String.format("An error occured while %s was registering a Boiler fuel source", modName));
        return;
    }
    boilerFuel.put(fluid, heatValuePerBucket);
    FMLLog.log("Railcraft", Level.DEBUG, String.format("%s registered \"%s\" as a valid Boiler fuel source with %d heat.", modName, fluid.getName(), heatValuePerBucket));
}
 
Example 15
Source File: TLog.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public void log(Level level, Throwable throwable, String message,
        Object... args) {
    Throwable t = null;
    if (throwable != null) {
        t = new Throwable();
        t.initCause(throwable);
        t.fillInStackTrace();
    }
    FMLLog.log(mTag, level, t, String.format(message, args));
}
 
Example 16
Source File: LogHelper.java    From wailanbt with MIT License 4 votes vote down vote up
private static void log(Level logLevel, Object object)
{
    FMLLog.log(Reference.MOD_NAME, logLevel, String.valueOf(object));
}
 
Example 17
Source File: BeefCoreLog.java    From BeefCore with MIT License 4 votes vote down vote up
public static void log(Level level, String format, Object... data)
{
	FMLLog.log(level, format, data);
}
 
Example 18
Source File: BRLog.java    From BigReactors with MIT License 4 votes vote down vote up
public static void log(Level level, String format, Object... data)
{
	FMLLog.log(LOGCHANNEL, level,  format, data);
}
 
Example 19
Source File: LogHelper.java    From LetsModReboot with GNU General Public License v3.0 4 votes vote down vote up
public static void log(Level logLevel, Object object)
{
    FMLLog.log(Reference.MOD_NAME, logLevel, String.valueOf(object));
}
 
Example 20
Source File: LogHelper.java    From OmniOcular with Apache License 2.0 4 votes vote down vote up
private static void log(Level logLevel, Object object) {
    FMLLog.log(Reference.MOD_NAME, logLevel, "%s", String.valueOf(object));
}