Replaced java logger with FML Logger

This commit is contained in:
Bernhard Bonigl committed 2014-07-14 18:12:48 +02:00
1 parent 1693333a61
commit 7ff01bedbd
10 files changed
+40 -34

No files matched your search

@@ -37,7 +37,6 @@ public class IguanaTweaksTConstruct {
@SidedProxy(clientSide=IguanaReference.PROXY_CLIENT_CLASS, serverSide=IguanaReference.PROXY_SERVER_CLASS)
public static CommonProxy proxy;
public static Logger ITconTweaksLog = Logger.getLogger("IguanaTweaksTConstruct");
public static List<Item> toolParts = null;
@EventHandler
@@ -77,7 +76,7 @@ public static Logger ITconTweaksLog = Logger.getLogger("IguanaTweaksTConstruct")
// TODO: need to re-implement harvest level tweaks
//HarvestLevelTweaks.init();
IguanaLog.log("Starting event handler");
IguanaLog.info("Starting event handler");
//MinecraftForge.EVENT_BUS.register(new IguanaEventHandler());
}
@@ -50,7 +50,7 @@ public class IguanaModClean extends ItemModifier {
}
// Create blank tool
IguanaLog.log("replacing tool");
IguanaLog.info("replacing tool");
tool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, extraStack, name);
}
@@ -20,7 +20,7 @@ public class IguanaBlocks {
{
//TOOL STATION + FORGE
IguanaLog.log("Modifying GUIs");
IguanaLog.info("Modifying GUIs");
TinkerTools.toolStationWood = null;
TinkerTools.toolStationWood = new IguanaToolStationBlock(Material.wood).setBlockName("ToolStation");
@@ -36,7 +36,7 @@ public class IguanaBlocks {
//SKULLS
IguanaLog.log("Adding skull blocks");
IguanaLog.info("Adding skull blocks");
// TODO: Find a way to change vanilla skulls
/*Blocks.skull = null;
newSkullBlock = new IguanaBlockSkull().setHardness(1.0F).setStepSound(Block.soundTypeSand).setBlockName("skull").setBlockTextureName("skull");
@@ -36,7 +36,7 @@ public class IguanaItems {
{
//CLAY BUCKETS
IguanaLog.log("Adding clay buckets");
IguanaLog.info("Adding clay buckets");
clayBucketUnfired = new Item().setUnlocalizedName("iguanatweakstconstruct:clayBucketUnfired").setTextureName("iguanatweakstconstruct:clayBucketUnfired").setMaxStackSize(16).setCreativeTab(CreativeTabs.tabMisc);
clayBucketFired = new ClayBucket(Blocks.air).setUnlocalizedName("iguanatweakstconstruct:clayBucketFired").setTextureName("iguanatweakstconstruct:clayBucketFired").setMaxStackSize(16);
clayBucketWater = new ClayBucket(Blocks.flowing_water).setUnlocalizedName("iguanatweakstconstruct:clayBucketWater").setTextureName("iguanatweakstconstruct:clayBucketWater").setContainerItem(clayBucketFired);
@@ -114,7 +114,7 @@ public class IguanaItems {
ToolBuilder.addCustomToolRecipe(new BowRecipe(TinkerTools.toolRod, TinkerTools.bowstring, TinkerTools.toolRod, TinkerTools.shortbow));
//SKULL ITEM
IguanaLog.log("Adding skull item");
IguanaLog.info("Adding skull item");
// TODO: find a way to replace vanilla skull
/*Item.itemsList[Item.skull.itemID] = null;
Item.skull = new IguanaItemSkull(141).setUnlocalizedName("skull").setTextureName("skull");
@@ -126,7 +126,7 @@ public class IguanaItems {
//COBALT ARMOR
if (IguanaConfig.cobaltArmor)
{
IguanaLog.log("Changing diamond armor to cobalt armor");
IguanaLog.info("Changing diamond armor to cobalt armor");
// TODO: Implement Cobalt Armor
/*LanguageRegistry.addName(new ItemStack(Item.helmetDiamond), "Cobalt Helmet");
@@ -38,7 +38,7 @@ public class HarvestLevelTweaks {
public static void init()
{
// TOOLS
IguanaLog.log("Modifying harvest levels of tools");
IguanaLog.info("Modifying harvest levels of tools");
ForgeHooks hooks = new ForgeHooks();
Field f = null;
try {
@@ -97,7 +97,7 @@ public class HarvestLevelTweaks {
if (harvestLevel != newHarvestLevel)
{
if (IguanaConfig.logMiningLevelChanges) IguanaLog.log("Changing mining level of " + entry.getKey().getUnlocalizedName() + " from " + harvestLevel + " to " + newHarvestLevel);
if (IguanaConfig.logMiningLevelChanges) IguanaLog.info("Changing mining level of " + entry.getKey().getUnlocalizedName() + " from " + harvestLevel + " to " + newHarvestLevel);
entry.setValue(Arrays.asList(toolClass, newHarvestLevel));
}
@@ -116,7 +116,7 @@ public class HarvestLevelTweaks {
harvestLevelCobalt += boostMod;
harvestLevelManyullyn += boostMod;
IguanaLog.log("Modifying required harvest levels of blocks");
IguanaLog.info("Modifying required harvest levels of blocks");
try {
f = ForgeHooks.class.getDeclaredField("toolHarvestLevels");
} catch (NoSuchFieldException e) {
@@ -164,7 +164,7 @@ public class HarvestLevelTweaks {
if (requiredHarvestLevel != newRequiredHarvestLevel)
{
if (IguanaConfig.logHarvestLevelChanges) IguanaLog.log("Changing required harvest level of " + block.getUnlocalizedName() + ":" + metadata + " from " + requiredHarvestLevel + " to " + newRequiredHarvestLevel);
if (IguanaConfig.logHarvestLevelChanges) IguanaLog.info("Changing required harvest level of " + block.getUnlocalizedName() + ":" + metadata + " from " + requiredHarvestLevel + " to " + newRequiredHarvestLevel);
entry.setValue(newRequiredHarvestLevel);
}
@@ -184,7 +184,7 @@ public class HarvestLevelTweaks {
}
}
IguanaLog.log("Modifying required harvest levels of vanilla blocks");
IguanaLog.info("Modifying required harvest levels of vanilla blocks");
Blocks.obsidian.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.diamond_ore.setHarvestLevel("pickaxe", harvestLevelBronze);
Blocks.diamond_block.setHarvestLevel("pickaxe", harvestLevelBronze);
@@ -242,7 +242,7 @@ public class HarvestLevelTweaks {
Block block = Block.getBlockFromItem(oreStack.getItem());
if (block == Blocks.air)
{
IguanaLog.log("Warning: " + oreStack.getUnlocalizedName() + " is invalid block");
IguanaLog.warn("Warning: " + oreStack.getUnlocalizedName() + " is invalid block");
return;
}
@@ -12,7 +12,7 @@ public class MaterialTweaks {
{
// TINKERS
IguanaLog.log("Modifying TConstruct materials");
IguanaLog.info("Modifying TConstruct materials");
float durMod = IguanaConfig.durabilityPercentage / 100F;
float speedMod = IguanaConfig.miningSpeedPercentage / 100F;
@@ -33,7 +33,7 @@ public class ModifierTweaks
{
// REMOVE OLD MODIFIERS
IguanaLog.log("Removing old modifiers");
IguanaLog.info("Removing old modifiers");
Iterator<ItemModifier> i = ModifyBuilder.instance.itemModifiers.iterator();
while (i.hasNext())
{
@@ -59,7 +59,7 @@ public class ModifierTweaks
}
// REPLACE OLD MODIFIERS
IguanaLog.log("Replacing old modifiers");
IguanaLog.info("Replacing old modifiers");
if (IguanaConfig.partReplacement)
ModifyBuilder.registerModifier(new IguanaModUpgrade());
@@ -99,7 +99,7 @@ public class ModifierTweaks
// MINING BOOST MODIFIERS
if (IguanaConfig.mobHeadPickaxeBoost)
{
IguanaLog.log("Adding mob head modifiers");
IguanaLog.info("Adding mob head modifiers");
// add modifers
ModifyBuilder.registerModifier(new IguanaModHeads(new ItemStack[] { new ItemStack(Items.skull, 1, 0) }, 20, TConstructRegistry.getMaterial("Iron").harvestLevel(), "Skeleton Skull",
@@ -128,7 +128,7 @@ public class ModifierTweaks
// LEVELING MODIFIER
if (IguanaConfig.toolLeveling)
{
IguanaLog.log("Adding leveling active modifier");
IguanaLog.info("Adding leveling active modifier");
TConstructRegistry.activeModifiers.add(0, new IguanaActiveToolMod());
}
}
@@ -12,7 +12,7 @@ public class RemoveVanillaTools {
public static void init()
{
//Remove vanilla tools
IguanaLog.log("Removing vanilla tool recipes");
IguanaLog.info("Removing vanilla tool recipes");
//Wood
if (IguanaConfig.restrictedWoodParts.contains(1) || IguanaConfig.restrictedWoodParts.contains(2) || IguanaConfig.restrictedWoodParts.contains(9))
@@ -37,27 +37,27 @@ public class VariousTweaks {
}
catch (Exception e)
{
IguanaLog.log("Failed to suppress missing tool logs");
IguanaLog.warn("Failed to suppress missing tool logs");
e.printStackTrace();
}
//REMOVE STONE TORCH
if (IguanaConfig.removeStoneTorchRecipe)
{
IguanaLog.log("Removing stone torch recipe");
IguanaLog.info("Removing stone torch recipe");
RecipeRemover.removeAnyRecipe(new ItemStack(TinkerWorld.stoneTorch, 4));
}
// GRAVEL TO FLINT RECIPE
if (IguanaConfig.addFlintRecipe) {
IguanaLog.log("Adding gravel to flint recipe");
IguanaLog.info("Adding gravel to flint recipe");
GameRegistry.addShapelessRecipe(new ItemStack(Items.flint), new Object[] {Blocks.gravel, Blocks.gravel, Blocks.gravel, Blocks.gravel});
}
//SOFTEN SEARED BLOCKS
IguanaLog.log("Softening seared blocks");
IguanaLog.info("Softening seared blocks");
TinkerSmeltery.smeltery.setHardness(1.5F);
TinkerSmeltery.lavaTank.setHardness(1.5F);
TinkerSmeltery.searedBlock.setHardness(1.5F);
@@ -65,7 +65,7 @@ public class VariousTweaks {
// REUSABLE PARTS
IguanaLog.log("Making non-metal parts reusable in part builder");
IguanaLog.info("Making non-metal parts reusable in part builder");
int[] nonMetals = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 17 };
PatternBuilder pb = PatternBuilder.instance;
@@ -85,7 +85,7 @@ public class VariousTweaks {
// REMOVE RESTRICTED PARTS FROM TINKERS HOUSE LOOT
IguanaLog.log("Removing restricted parts from Tinker House chest");
IguanaLog.info("Removing restricted parts from Tinker House chest");
for (int i = 0; i < IguanaTweaksTConstruct.toolParts.size(); ++i)
{
@@ -122,7 +122,7 @@ public class VariousTweaks {
// SIMPLE WOOD PATTERN CRAFTING RECIPE
if (IguanaConfig.easyBlankPatternRecipe)
{
IguanaLog.log("Adding easy blank pattern recipe");
IguanaLog.info("Adding easy blank pattern recipe");
GameRegistry.addShapedRecipe(new ItemStack(TinkerTools.blankPattern), "ss", "ss", 's', new ItemStack(Items.stick));
}
@@ -130,7 +130,7 @@ public class VariousTweaks {
//ROTATING PATTERN CRAFTING
if (IguanaConfig.easyPatternCrafting)
{
IguanaLog.log("Adding rotating pattern crafting recipes");
IguanaLog.info("Adding rotating pattern crafting recipes");
// TODO: Find Crafting Handler replacement
//GameRegistry.registerCraftingHandler(new IguanaPatternCraftingHandler());
@@ -167,7 +167,7 @@ public class VariousTweaks {
// ALTERNATIVE PART CRAFTING
if (IguanaConfig.easyPartCrafting)
{
IguanaLog.log("Adding easy part crafting");
IguanaLog.info("Adding easy part crafting");
GameRegistry.addRecipe(new IguanaPartBuildRecipe());
// TODO: Find crafting Handler replacement
//GameRegistry.registerCraftingHandler(new IguanaPartCraftingHandler());
@@ -177,7 +177,7 @@ public class VariousTweaks {
// ALTERNATIVE TOOL CRAFTING
if (IguanaConfig.easyToolCreation || IguanaConfig.easyToolModification)
{
IguanaLog.log("Adding easy tool crafting");
IguanaLog.info("Adding easy tool crafting");
GameRegistry.addRecipe(new IguanaToolBuildRecipe());
}
@@ -1,11 +1,18 @@
package iguanaman.iguanatweakstconstruct.util;
import static iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct.ITconTweaksLog;
public class IguanaLog {
import cpw.mods.fml.common.FMLLog;
import iguanaman.iguanatweakstconstruct.reference.IguanaReference;
import org.apache.logging.log4j.Level;
public static void log(String text)
public class IguanaLog {
public static void log(Level level, Object obj)
{
ITconTweaksLog.info(text);
FMLLog.log(IguanaReference.MOD_NAME, level, String.valueOf(obj));
}
public static void info(Object obj) { log(Level.INFO, obj); }
public static void warn(Object obj) { log(Level.WARN, obj); }
public static void error(Object obj) { log(Level.ERROR, obj); }
public static void debug(Object obj) { log(Level.DEBUG, obj); }
public static void trace(Object obj) { log(Level.TRACE, obj); }
}