From 38dee74ac8542640075537baf5ac406f3ec1fb9a Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Thu, 20 Feb 2014 14:20:02 -0500 Subject: [PATCH] change API logger to log4j2 --- .../library/TConstructRegistry.java | 22 ++++++++++--------- .../tconstruct/library/tools/ToolCore.java | 16 +++++--------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index 31258cc687a..d015f27b0f6 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -5,7 +5,9 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.logging.Logger; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import mantle.lib.TabTools; import net.minecraft.item.Item; @@ -31,7 +33,7 @@ public class TConstructRegistry { public static TConstructRegistry instance = new TConstructRegistry(); - public static Logger logger = Logger.getLogger("TCon-API"); + public static Logger logger = LogManager.getLogger("TCon-API"); /* Creative tabs */ public static TabTools toolTab; @@ -70,7 +72,7 @@ public static void addItemToDirectory (String name, Item itemstack) { Item add = itemDirectory.get(name); if (add != null) - logger.warning(name + " is already present in the Item directory"); + logger.warn(name + " is already present in the Item directory"); itemDirectory.put(name, itemstack); } @@ -87,7 +89,7 @@ public static Item getItem (String name) { Item ret = itemDirectory.get(name); if (ret == null) - logger.warning("Could not find " + name + " in the Item directory"); + logger.warn("Could not find " + name + " in the Item directory"); return ret; } @@ -125,7 +127,7 @@ public static void addItemStackToDirectory (String name, ItemStack itemstack) { ItemStack add = itemstackDirectory.get(name); if (add != null) - logger.warning(name + " is already present in the ItemStack directory"); + logger.warn(name + " is already present in the ItemStack directory"); itemstackDirectory.put(name, itemstack); } @@ -142,7 +144,7 @@ public static ItemStack getItemStack (String name) { ItemStack ret = itemstackDirectory.get(name); if (ret == null) - logger.warning("Could not find " + name + " in the ItemStack directory"); + logger.warn("Could not find " + name + " in the ItemStack directory"); return ret; } @@ -221,7 +223,7 @@ public static void addToolRecipe (ToolCore output, Item... parts) { ToolBuilder tb = ToolBuilder.instance; if (parts.length < 2 || parts.length > 4) - logger.warning("Wrong amount of items to craft into a tool"); + logger.warn("Wrong amount of items to craft into a tool"); tb.addToolRecipe(output, parts); } @@ -493,7 +495,7 @@ LiquidCasting tableCasting () } catch (Exception e) { - logger.warning("Could not find casting table recipes."); + logger.warn("Could not find casting table recipes."); return null; } } @@ -514,7 +516,7 @@ LiquidCasting basinCasting () } catch (Exception e) { - logger.warning("Could not find casting basin recipes."); + logger.warn("Could not find casting basin recipes."); return null; } } @@ -535,7 +537,7 @@ Detailing chiselDetailing () } catch (Exception e) { - logger.warning("Could not find chisel detailing recipes."); + logger.warn("Could not find chisel detailing recipes."); return null; } } diff --git a/src/main/java/tconstruct/library/tools/ToolCore.java b/src/main/java/tconstruct/library/tools/ToolCore.java index 8099b1c04ec..6788a1881a6 100644 --- a/src/main/java/tconstruct/library/tools/ToolCore.java +++ b/src/main/java/tconstruct/library/tools/ToolCore.java @@ -58,8 +58,8 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa { // TE power constants -- TODO grab these from the items added protected int capacity = 400000; - protected int maxReceive = 75; - protected int maxExtract = 75; + protected int maxReceive = 80; + protected int maxExtract = 80; protected Random random = new Random(); protected int damageVsEntity; @@ -546,23 +546,19 @@ public void buildTool (int id, String name, List list) boolean supress = false; try { - clazz = Class.forName("tconstruct.common.TRepo"); // TODO: Make - // sure this - // is still - // working - // in 1.7. + clazz = Class.forName("tconstruct.common.TRepo"); fld = clazz.getField("supressMissingToolLogs"); supress = fld.getBoolean(fld); } catch (Exception e) { - TConstructRegistry.logger.severe("TConstruct Library could not find parts of TContent"); + TConstructRegistry.logger.error("TConstruct Library could not find parts of TContent"); e.printStackTrace(); } if (!supress) { - TConstructRegistry.logger.severe("Creative builder failed tool for " + name + this.getToolName()); - TConstructRegistry.logger.severe("Make sure you do not have item ID conflicts"); + TConstructRegistry.logger.error("Creative builder failed tool for " + name + this.getToolName()); + TConstructRegistry.logger.error("Make sure you do not have item ID conflicts"); } } else