Moving things where they belong, and making a proper logger
This commit is contained in:
parent
54732bdb73
commit
ee9326728c
7 changed files with 86 additions and 53 deletions
|
|
@ -42,15 +42,4 @@ public class CrissCross
|
|||
CRecipes.init();
|
||||
proxy.init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public static void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
ItemDust.oreDictionaryInit();
|
||||
}
|
||||
|
||||
public static void printErr(String string)
|
||||
{
|
||||
System.out.println(string);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,8 +19,8 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
|
||||
public class ItemDust extends Item
|
||||
{
|
||||
private static ArrayList<String> dustNames = new ArrayList<String>();
|
||||
private static ArrayList<Integer> colors = new ArrayList<Integer>();
|
||||
public static ArrayList<String> dustNames = new ArrayList<String>();
|
||||
public static ArrayList<Integer> colors = new ArrayList<Integer>();
|
||||
public static IIcon overlay;
|
||||
public static IIcon base;
|
||||
|
||||
|
|
@ -85,29 +85,4 @@ public class ItemDust extends Item
|
|||
for(int i = 0; i < dustNames.size(); i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
public static void oreDictionaryInit()
|
||||
{
|
||||
for(int i = 0; i < ConfigHandler.electroextractorOreDictInputs.length; i++)
|
||||
{
|
||||
String[] entry = ConfigHandler.electroextractorOreDictInputs[i].split(":");
|
||||
if(OreDictionary.doesOreNameExist("ore" + entry[0]))
|
||||
{
|
||||
ArrayList<ItemStack> ores = OreDictionary.getOres("ore" + entry[0]);
|
||||
ItemDust.addDustType(entry[0], Integer.parseInt(entry[1]));
|
||||
for(int j = 0; j < ores.size(); j++)
|
||||
TileEntityElectroextractor.addRecipe(ores.get(j), new ItemStack(CCItems.dusts, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < dustNames.size(); i++)
|
||||
{
|
||||
ItemStack ingot = null;
|
||||
if(OreDictionary.doesOreNameExist("ingot" + dustNames.get(i)))
|
||||
ingot = OreDictionary.getOres("ingot" + dustNames.get(i)).get(0);
|
||||
if(ingot != null)
|
||||
GameRegistry.addSmelting(new ItemStack(CCItems.dusts, 1, i), ingot, 0.0F);
|
||||
OreDictionary.registerOre("dust" + dustNames.get(i), new ItemStack(CCItems.dusts, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.oitsjustjose.criss_cross.CrissCross;
|
|||
import com.oitsjustjose.criss_cross.Blocks.CCBlocks;
|
||||
import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
|
@ -36,7 +37,7 @@ public class CRecipes
|
|||
}
|
||||
else
|
||||
{
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.woodchipperRecipeItem +
|
||||
CCLog.warn("Item " + ConfigHandler.woodchipperRecipeItem +
|
||||
"could not be added as part of the recipe of the Woodchipper. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +65,7 @@ public class CRecipes
|
|||
}
|
||||
else
|
||||
{
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.electroextractorRecipeItem +
|
||||
CCLog.warn("Item " + ConfigHandler.electroextractorRecipeItem +
|
||||
" could not be added as part of the recipe of the electroextractor. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +93,7 @@ public class CRecipes
|
|||
}
|
||||
else
|
||||
{
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.cropomatorRecipeItem +
|
||||
CCLog.warn("Item " + ConfigHandler.cropomatorRecipeItem +
|
||||
" could not be added as part of the recipe of the cropomator. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.oitsjustjose.criss_cross.Recipes;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityCropomator;
|
||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
|
@ -21,7 +22,7 @@ public class CropomatorRecipes
|
|||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||
TileEntityCropomator.addItemStackToOutputs(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
" could not be added to the Cropomator's recipe list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
if(unlocStack.length == 3)
|
||||
|
|
@ -32,14 +33,14 @@ public class CropomatorRecipes
|
|||
TileEntityCropomator.addItemStackToOutputs(newStack);
|
||||
}
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
" could not be added to the Cropomator's recipe list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
CrissCross.printErr("[CrissCross]: Error reading itemstack for inputs from input file at item: " + (i + 1));
|
||||
CCLog.warn("[CrissCross]: Error reading itemstack for inputs from input file at item: " + (i + 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -57,7 +58,7 @@ public class CropomatorRecipes
|
|||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||
TileEntityCropomator.addItemStackToCatalysts(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1));
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
" could not be added to the Cropomator's catalyst list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
@ -69,13 +70,13 @@ public class CropomatorRecipes
|
|||
TileEntityCropomator.addItemStackToCatalysts(newStack);
|
||||
}
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.cropomatorInputs[i] +
|
||||
" could not be added to the Cropomator's catalyst list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
CrissCross.printErr("[CrissCross]: Error reading itemstack for catalysts from input file at item: " + (i + 1));
|
||||
CCLog.warn("[CrissCross]: Error reading itemstack for catalysts from input file at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,55 @@
|
|||
package com.oitsjustjose.criss_cross.Recipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.Items.CCItems;
|
||||
import com.oitsjustjose.criss_cross.Items.ItemDust;
|
||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityElectroextractor;
|
||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ElectroextractorRecipes
|
||||
{
|
||||
public static void initRecipes()
|
||||
{
|
||||
oreDictionaryInit();
|
||||
TileEntityElectroextractor.addRecipe(Blocks.diamond_ore, new ItemStack(Items.diamond));
|
||||
TileEntityElectroextractor.addRecipe(Blocks.emerald_ore, new ItemStack(Items.emerald));
|
||||
TileEntityElectroextractor.addRecipe(Blocks.coal_ore, new ItemStack(Items.coal));
|
||||
}
|
||||
|
||||
public static void oreDictionaryInit()
|
||||
{
|
||||
for(int i = 0; i < ConfigHandler.electroextractorOreDictInputs.length; i++)
|
||||
{
|
||||
String[] entry = ConfigHandler.electroextractorOreDictInputs[i].split(":");
|
||||
if(OreDictionary.doesOreNameExist("ore" + entry[0]) && OreDictionary.doesOreNameExist("ingot" + entry[0]))
|
||||
{
|
||||
ArrayList<ItemStack> ores = OreDictionary.getOres("ore" + entry[0]);
|
||||
ItemDust.addDustType(entry[0], Integer.parseInt(entry[1]));
|
||||
for(int j = 0; j < ores.size(); j++)
|
||||
TileEntityElectroextractor.addRecipe(ores.get(j), new ItemStack(CCItems.dusts, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < ItemDust.dustNames.size(); i++)
|
||||
{
|
||||
ItemStack ingot = null;
|
||||
if(OreDictionary.doesOreNameExist("ingot" + ItemDust.dustNames.get(i)))
|
||||
ingot = OreDictionary.getOres("ingot" + ItemDust.dustNames.get(i)).get(0);
|
||||
if(ingot != null)
|
||||
GameRegistry.addSmelting(new ItemStack(CCItems.dusts, 1, i), ingot, 0.0F);
|
||||
OreDictionary.registerOre("dust" + ItemDust.dustNames.get(i), new ItemStack(CCItems.dusts, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public static void initFuels()
|
||||
{
|
||||
for(int i = 0; i < ConfigHandler.electroextractorEnergySources.length; i++)
|
||||
|
|
@ -30,7 +62,7 @@ public class ElectroextractorRecipes
|
|||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||
TileEntityElectroextractor.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.electroextractorEnergySources[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i] +
|
||||
" could not be added to the Electroextractor's fuel list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
@ -42,13 +74,13 @@ public class ElectroextractorRecipes
|
|||
TileEntityElectroextractor.addFuel(newStack);
|
||||
}
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.electroextractorEnergySources[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.electroextractorEnergySources[i] +
|
||||
" could not be added to the Electroextractor's fuel list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
CrissCross.printErr("[CrissCross]: Error reading itemstack for electroextractor's energy sources at item: " + (i + 1));
|
||||
CCLog.warn("[CrissCross]: Error reading itemstack for electroextractor's energy sources at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
|
||||
import com.oitsjustjose.criss_cross.CrissCross;
|
||||
import com.oitsjustjose.criss_cross.TileEntity.TileEntityWoodchipper;
|
||||
import com.oitsjustjose.criss_cross.Util.CCLog;
|
||||
import com.oitsjustjose.criss_cross.Util.ConfigHandler;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
|
@ -62,7 +63,7 @@ public class WoodchipperRecipes
|
|||
if(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 1) != null)
|
||||
TileEntityWoodchipper.addFuel(GameRegistry.findItemStack(unlocStack[0], unlocStack[1], 0));
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.woodchipperFuels[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] +
|
||||
" could not be added to the Woodchipper's fuel list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
|
||||
|
|
@ -74,13 +75,13 @@ public class WoodchipperRecipes
|
|||
TileEntityWoodchipper.addFuel(newStack);
|
||||
}
|
||||
else
|
||||
CrissCross.printErr("[CrissCross] Item " + ConfigHandler.woodchipperFuels[i] +
|
||||
CCLog.warn("Item " + ConfigHandler.woodchipperFuels[i] +
|
||||
" could not be added to the Woodchipper's fuel list. Please confirm you have the name and formatting correct.");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
CrissCross.printErr("[CrissCross]: Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
||||
CCLog.warn("[CrissCross]: Error reading itemstack for Woodchipper's energy sources at item: " + (i + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
src/main/java/com/oitsjustjose/criss_cross/Util/CCLog.java
Normal file
34
src/main/java/com/oitsjustjose/criss_cross/Util/CCLog.java
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package com.oitsjustjose.criss_cross.Util;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class CCLog
|
||||
{
|
||||
private static Logger LOGGER = LogManager.getLogger(Reference.modid);
|
||||
|
||||
public CCLog()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void warn(String msg)
|
||||
{
|
||||
LOGGER.warn(msg);
|
||||
}
|
||||
|
||||
public static void error(String msg)
|
||||
{
|
||||
LOGGER.error(msg);
|
||||
}
|
||||
|
||||
public static void info(String msg)
|
||||
{
|
||||
LOGGER.info(msg);
|
||||
}
|
||||
|
||||
public static void debug(String msg)
|
||||
{
|
||||
LOGGER.debug(msg);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue