Added a LogHelper for easy logging
This commit is contained in:
parent
a2995d8cd5
commit
042f18fbf6
6 changed files with 72 additions and 7 deletions
|
@ -8,6 +8,7 @@ import techreborn.init.ModBlocks;
|
|||
import techreborn.init.ModItems;
|
||||
import techreborn.init.ModRecipes;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.util.LogHelper;
|
||||
import techreborn.world.TROreGen;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
@ -29,6 +30,7 @@ public class Core {
|
|||
.replace(ModInfo.MOD_ID, "TechReborn");
|
||||
|
||||
config = ConfigTechReborn.initialize(new File(path));
|
||||
LogHelper.info("PreInitialization Compleate");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
@ -44,6 +46,7 @@ public class Core {
|
|||
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
||||
//Register Gui Handler
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
||||
LogHelper.info("Initialization Compleate");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import techreborn.itemblocks.ItemBlockQuantumTank;
|
|||
import techreborn.tiles.TileQuantumChest;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
import techreborn.tiles.TileThermalGenerator;
|
||||
import techreborn.util.LogHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -38,7 +39,8 @@ public class ModBlocks {
|
|||
|
||||
ore = new BlockOre(Material.rock);
|
||||
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
|
||||
|
||||
LogHelper.info("TechReborns Blocks Loaded");
|
||||
|
||||
registerOreDict();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import techreborn.items.ItemDusts;
|
|||
import techreborn.items.ItemGems;
|
||||
import techreborn.items.ItemIngots;
|
||||
import techreborn.items.ItemParts;
|
||||
import techreborn.util.LogHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
|
@ -24,7 +25,8 @@ public class ModItems {
|
|||
GameRegistry.registerItem(gems, "gem");
|
||||
parts = new ItemParts();
|
||||
GameRegistry.registerItem(parts, "part");
|
||||
|
||||
LogHelper.info("TechReborns Items Loaded");
|
||||
|
||||
registerOreDict();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.init;
|
|||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import techreborn.util.LogHelper;
|
||||
import techreborn.util.RecipeRemover;
|
||||
|
||||
public class ModRecipes {
|
||||
|
@ -18,27 +19,27 @@ public class ModRecipes {
|
|||
|
||||
public static void removeIc2Recipes()
|
||||
{
|
||||
|
||||
LogHelper.info("IC2 Recipes Removed");
|
||||
}
|
||||
|
||||
public static void addShappedRecipes()
|
||||
{
|
||||
|
||||
LogHelper.info("Shapped Recipes Added");
|
||||
}
|
||||
|
||||
public static void addShaplessRecipes()
|
||||
{
|
||||
|
||||
LogHelper.info("Shapless Recipes Added");
|
||||
}
|
||||
|
||||
public static void addSmeltingRecipes()
|
||||
{
|
||||
|
||||
LogHelper.info("Smelting Recipes Added");
|
||||
}
|
||||
|
||||
public static void addMachineRecipes()
|
||||
{
|
||||
|
||||
LogHelper.info("Machine Recipes Added");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
55
src/main/java/techreborn/util/LogHelper.java
Normal file
55
src/main/java/techreborn/util/LogHelper.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package techreborn.util;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import techreborn.lib.ModInfo;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class LogHelper {
|
||||
|
||||
public static void log(Level logLevel, Object object)
|
||||
{
|
||||
FMLLog.log(ModInfo.MOD_NAME, logLevel, String.valueOf(object));
|
||||
}
|
||||
|
||||
public static void all(Object object)
|
||||
{
|
||||
log(Level.ALL, object);
|
||||
}
|
||||
|
||||
public static void debug(Object object)
|
||||
{
|
||||
log(Level.DEBUG, object);
|
||||
}
|
||||
|
||||
public static void error(Object object)
|
||||
{
|
||||
log(Level.ERROR, object);
|
||||
}
|
||||
|
||||
public static void fatal(Object object)
|
||||
{
|
||||
log(Level.FATAL, object);
|
||||
}
|
||||
|
||||
public static void info(Object object)
|
||||
{
|
||||
log(Level.INFO, object);
|
||||
}
|
||||
|
||||
public static void off(Object object)
|
||||
{
|
||||
log(Level.OFF, object);
|
||||
}
|
||||
|
||||
public static void trace(Object object)
|
||||
{
|
||||
log(Level.TRACE, object);
|
||||
}
|
||||
|
||||
public static void warn(Object object)
|
||||
{
|
||||
log(Level.WARN, object);
|
||||
}
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import java.util.Random;
|
|||
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.util.LogHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
@ -43,6 +44,7 @@ public class TROreGen implements IWorldGenerator{
|
|||
oreSheldonite = new WorldGenMinable(ModBlocks.ore, 9, 8, Blocks.end_stone);
|
||||
oreOlivine = new WorldGenMinable(ModBlocks.ore, 10, 8, Blocks.end_stone);
|
||||
oreSodalite = new WorldGenMinable(ModBlocks.ore, 11, 8, Blocks.end_stone);
|
||||
LogHelper.info("WorldGen Loaded");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue