Switch main content to a proper logger
Need to figure out what to keep from old API and move that over as well.
This commit is contained in:
parent
36ce215b6b
commit
acc0acb806
8 changed files with 18 additions and 17 deletions
|
@ -29,6 +29,8 @@ import net.minecraftforge.fml.common.SidedProxy;
|
||||||
import net.minecraftforge.fml.common.event.*;
|
import net.minecraftforge.fml.common.event.*;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -39,14 +41,15 @@ public class BloodMagic {
|
||||||
public static final String NAME = "Blood Magic: Alchemical Wizardry";
|
public static final String NAME = "Blood Magic: Alchemical Wizardry";
|
||||||
public static final String VERSION = "@VERSION@";
|
public static final String VERSION = "@VERSION@";
|
||||||
public static final String DEPEND = "required-after:guideapi;";
|
public static final String DEPEND = "required-after:guideapi;";
|
||||||
|
public static final Logger LOGGER = LogManager.getLogger(NAME.substring(0, NAME.indexOf(":")));
|
||||||
|
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||||
|
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
||||||
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
|
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem() {
|
public ItemStack getTabIconItem() {
|
||||||
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
|
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
|
||||||
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
|
||||||
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
|
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem() {
|
public ItemStack getTabIconItem() {
|
||||||
|
@ -68,7 +71,6 @@ public class BloodMagic {
|
||||||
FluidRegistry.enableUniversalBucket();
|
FluidRegistry.enableUniversalBucket();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogHelper logger = new LogHelper(MODID);
|
|
||||||
private File configDir;
|
private File configDir;
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class StorageBlockCraftingManager {
|
||||||
public void addStorageBlockRecipes() {
|
public void addStorageBlockRecipes() {
|
||||||
// this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
|
// this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
|
||||||
|
|
||||||
BloodMagic.instance.logger.info("Total number of compression recipes: " + this.recipes.size());
|
BloodMagic.LOGGER.info("Total number of compression recipes: {}", this.recipes.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack findMatchingRecipe(InventoryCrafting craftingInventory, World world) {
|
public ItemStack findMatchingRecipe(InventoryCrafting craftingInventory, World world) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class MeteorConfigHandler {
|
||||||
|
|
||||||
public static void handleMeteors(boolean checkNewVersion) {
|
public static void handleMeteors(boolean checkNewVersion) {
|
||||||
if (meteorDir == null) {
|
if (meteorDir == null) {
|
||||||
BloodMagic.instance.logger.error("Attempted to handle meteor config but the folder has not been initialized. Was this run too early?");
|
BloodMagic.LOGGER.error("Attempted to handle meteor config but the folder has not been initialized. Was this run too early?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,10 +152,9 @@ public class ClientProxy extends CommonProxy {
|
||||||
Map<String, RenderPlayer> skinMap = ObfuscationReflectionHelper.getPrivateValue(RenderManager.class, renderManager, "skinMap", "field_178636_l");
|
Map<String, RenderPlayer> skinMap = ObfuscationReflectionHelper.getPrivateValue(RenderManager.class, renderManager, "skinMap", "field_178636_l");
|
||||||
skinMap.get("default").addLayer(new LayerBloodElytra(skinMap.get("default")));
|
skinMap.get("default").addLayer(new LayerBloodElytra(skinMap.get("default")));
|
||||||
skinMap.get("slim").addLayer(new LayerBloodElytra(skinMap.get("slim")));
|
skinMap.get("slim").addLayer(new LayerBloodElytra(skinMap.get("slim")));
|
||||||
BloodMagic.instance.logger.info("Elytra layer added");
|
BloodMagic.LOGGER.info("Elytra layer added");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
BloodMagic.instance.logger.error("Failed to set custom Elytra Layer for Elytra Living Armour Upgrade.");
|
BloodMagic.LOGGER.error("Failed to set custom Elytra Layer for Elytra Living Armour Upgrade.");
|
||||||
BloodMagic.instance.logger.error(e.getLocalizedMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class ModRecipes {
|
||||||
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.COBBLESTONE), 64);
|
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.COBBLESTONE), 64);
|
||||||
stopwatch.stop();
|
stopwatch.stop();
|
||||||
|
|
||||||
BloodMagic.instance.logger.info("Added compression recipes in {}", stopwatch);
|
BloodMagic.LOGGER.info("Added compression recipes in {}", stopwatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSoulForgeRecipes() {
|
public static void addSoulForgeRecipes() {
|
||||||
|
|
|
@ -120,11 +120,11 @@ public class HarvestHandlerPlantable implements IHarvestHandler {
|
||||||
HarvestRegistry.registerStandardCrop(crop, crop.getMaxAge());
|
HarvestRegistry.registerStandardCrop(crop, crop.getMaxAge());
|
||||||
}
|
}
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
BloodMagic.instance.logger.error("HarvestCraft integration cancelled; unable to find crop name mapper");
|
BloodMagic.LOGGER.error("HarvestCraft integration cancelled; unable to find crop name mapper");
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
BloodMagic.instance.logger.error("HarvestCraft integration cancelled; crop name lookup broke");
|
BloodMagic.LOGGER.error("HarvestCraft integration cancelled; crop name lookup broke");
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
BloodMagic.instance.logger.error("HarvestCraft integration cancelled; crop name lookup broke");
|
BloodMagic.LOGGER.error("HarvestCraft integration cancelled; crop name lookup broke");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -928,7 +928,7 @@ public class Utils {
|
||||||
Class<?> handlerClass = Class.forName(data.getClassName());
|
Class<?> handlerClass = Class.forName(data.getClassName());
|
||||||
Object handlerImpl = handlerClass.newInstance();
|
Object handlerImpl = handlerClass.newInstance();
|
||||||
MinecraftForge.EVENT_BUS.register(handlerImpl);
|
MinecraftForge.EVENT_BUS.register(handlerImpl);
|
||||||
BloodMagic.instance.logger.debug("Registering event handler for class {}", data.getClassName());
|
BloodMagic.LOGGER.debug("Registering event handler for class {}", data.getClassName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// No-op
|
// No-op
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,10 +210,10 @@ public class ClientHandler {
|
||||||
missingVariants.removeAll(missing);
|
missingVariants.removeAll(missing);
|
||||||
|
|
||||||
if (errored.size() > 0)
|
if (errored.size() > 0)
|
||||||
BloodMagic.instance.logger.info("Suppressed {} model errors from Blood Magic.", errored.size());
|
BloodMagic.LOGGER.info("Suppressed {} model errors from Blood Magic.", errored.size());
|
||||||
if (missing.size() > 0)
|
if (missing.size() > 0)
|
||||||
BloodMagic.instance.logger.info("Suppressed {} variant errors from Blood Magic.", missing.size());
|
BloodMagic.LOGGER.info("Suppressed {} variant errors from Blood Magic.", missing.size());
|
||||||
BloodMagic.instance.logger.debug("Suppressed discovered model/variant errors in {}", stopwatch.stop());
|
BloodMagic.LOGGER.debug("Suppressed discovered model/variant errors in {}", stopwatch.stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
// For some reason, we need some bad textures to be listed in the Crystal and Node models. This will hide that from the end user.
|
// For some reason, we need some bad textures to be listed in the Crystal and Node models. This will hide that from the end user.
|
||||||
|
@ -246,7 +246,7 @@ public class ClientHandler {
|
||||||
missingTextures.keySet().remove(mc);
|
missingTextures.keySet().remove(mc);
|
||||||
badTextureDomains.remove(mc);
|
badTextureDomains.remove(mc);
|
||||||
}
|
}
|
||||||
BloodMagic.instance.logger.debug("Suppressed required texture errors in {}", stopwatch.stop());
|
BloodMagic.LOGGER.debug("Suppressed required texture errors in {}", stopwatch.stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderRitualStones(EntityPlayerSP player, float partialTicks) {
|
private void renderRitualStones(EntityPlayerSP player, float partialTicks) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue