This commit is contained in:
oitsjustjose 2016-01-18 11:10:31 -05:00
commit 5257ebd0fe
4 changed files with 26 additions and 28 deletions

View file

@ -31,12 +31,12 @@ public class Config
public static String[] defaultCropomatorCatalysts = new String[] { "minecraft:dye:15" }; public static String[] defaultCropomatorCatalysts = new String[] { "minecraft:dye:15" };
// Electroextractor Configs // Electroextractor Configs
public static int electroextractorProcessTime; public static int electroextractorProcessTime;
public static int eeOutput; public static int electroextractorOutput;
public static String eeRecipeItem; public static String electroextractorRecipeItem;
public static String[] eeFuels; public static String[] electroextractorFuels;
public static String[] eeOreDictInputs; public static String[] electroextractorOreDictInputs;
public static String[] defaultEEOreDictInputs = new String[] { "Iron:12428902", "Gold:16772608", "Aluminum:15987699", "Cobalt:17663", "Ardite:13938485", "Copper:16751872", "Tin:15132390", "Silver:13297640", "Lead:5722979", "Platinum:11067903", "Mithril:4433113", "Nickel:16580553" }; public static String[] defaultelEctroextractorOreDictInputs = new String[] { "oreIron:12428902", "oreGold:16772608" };
public static String[] defaultEEFuels = new String[] { "minecraft:redstone_block" }; public static String[] defaultElectroextractorFuels = new String[] { "minecraft:redstone" };
// Woodchipper Configs // Woodchipper Configs
public static int woodchipperProcessTime; public static int woodchipperProcessTime;
public static int woodchipperOutput; public static int woodchipperOutput;
@ -51,7 +51,6 @@ public class Config
public static void init(File configFile) public static void init(File configFile)
{ {
// Create the configuration object from the given configuration file
if (config == null) if (config == null)
{ {
config = new Configuration(configFile); config = new Configuration(configFile);
@ -103,22 +102,22 @@ public class Config
electroextractorProcessTime = property.getInt(); electroextractorProcessTime = property.getInt();
propertyOrder.add(property.getName()); propertyOrder.add(property.getName());
property = config.get(category, "Electroextractor OreDictionary Entries", defaultEEOreDictInputs, "Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + " Remove the 'ore' part of the oredict name (i.e. 'oreIron' should be entered as 'Iron')" + "\n" + "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal."); property = config.get(category, "Electroextractor OreDictionary Entries", defaultelEctroextractorOreDictInputs, "Formatted as <OreDictName>:<DecimalColorYouWant>." + "\n" + "Use http://www.colorpicker.com/ to find a color and http://bit.ly/1RhPhcX to convert it from Hex to Decimal.");
eeOreDictInputs = property.getStringList(); electroextractorOreDictInputs = property.getStringList();
propertyOrder.add(property.getName()); propertyOrder.add(property.getName());
property = config.get(category, "Electroextractor's Fuel Items", defaultEEFuels, "Items considered as fuel for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>."); property = config.get(category, "Electroextractor's Fuel Items", defaultElectroextractorFuels, "Items considered as fuel for the Electroextractor. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.");
eeFuels = property.getStringList(); electroextractorFuels = property.getStringList();
propertyOrder.add(property.getName()); propertyOrder.add(property.getName());
property = config.get(category, "Electroextractor Output Quantity", 2); property = config.get(category, "Electroextractor Output Quantity", 2);
property.comment = "Quantity output by the Electroextractor"; property.comment = "Quantity output by the Electroextractor";
eeOutput = property.getInt(); electroextractorOutput = property.getInt();
propertyOrder.add(property.getName()); propertyOrder.add(property.getName());
property = config.get(category, "Electroextractor Crafting Item", "minecraft:diamond_block"); property = config.get(category, "Electroextractor Crafting Item", "minecraft:diamond_block");
property.comment = "Key crafting ingredient in Electroextractor's Recipe. Formatted as: <modid>:<item>:<meta> or <modid>:<item>."; property.comment = "Key crafting ingredient in Electroextractor's Recipe. Formatted as: <modid>:<item>:<meta> or <modid>:<item>.";
eeRecipeItem = property.getString(); electroextractorRecipeItem = property.getString();
propertyOrder.add(property.getName()); propertyOrder.add(property.getName());
Electroextractor.setPropertyOrder(propertyOrder); Electroextractor.setPropertyOrder(propertyOrder);
@ -175,7 +174,6 @@ public class Config
loadConfiguration(); loadConfiguration();
} }
// put this here because most references to finditemstack are due to this confighandler
public static ItemStack findItemStack(String modid, String name) public static ItemStack findItemStack(String modid, String name)
{ {
if (GameRegistry.findItem(modid, name) != null) if (GameRegistry.findItem(modid, name) != null)

View file

@ -65,7 +65,7 @@ public class CraftingRecipes
GameRegistry.addRecipe(new ItemStack(LibBlocks.woodchipper), new Object[] { "I#I", "SCS", "I#I", '#', Items.diamond_axe, 'I', Blocks.iron_bars, 'S', Items.golden_axe, 'C', centerItem }); GameRegistry.addRecipe(new ItemStack(LibBlocks.woodchipper), new Object[] { "I#I", "SCS", "I#I", '#', Items.diamond_axe, 'I', Blocks.iron_bars, 'S', Items.golden_axe, 'C', centerItem });
// Electroextractor Recipe // Electroextractor Recipe
unlocItem = Config.eeRecipeItem.split(":"); unlocItem = Config.electroextractorRecipeItem.split(":");
centerItem = new ItemStack(Blocks.diamond_block); centerItem = new ItemStack(Blocks.diamond_block);
if (Config.findItemStack(unlocItem[0], unlocItem[1]) != null) if (Config.findItemStack(unlocItem[0], unlocItem[1]) != null)
@ -78,7 +78,7 @@ public class CraftingRecipes
} }
else else
{ {
LogHelper.warn(Config.eeRecipeItem + " could not be implemented into the Electroextractor's Crafting Recipe."); LogHelper.warn(Config.electroextractorRecipeItem + " could not be implemented into the Electroextractor's Crafting Recipe.");
LogHelper.warn("The fallback, " + centerItem.getDisplayName() + ", has been used instead"); LogHelper.warn("The fallback, " + centerItem.getDisplayName() + ", has been used instead");
LogHelper.warn("Please confirm you have the name and formatting correct."); LogHelper.warn("Please confirm you have the name and formatting correct.");
System.out.println(); System.out.println();

View file

@ -40,9 +40,9 @@ public class MachineRecipes
parseWoodchipperRecipes(); parseWoodchipperRecipes();
parseScribeRecipes(); parseScribeRecipes();
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, Config.eeOutput)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.diamond_ore), new ItemStack(Items.diamond, Config.electroextractorOutput));
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore), new ItemStack(Items.emerald, Config.eeOutput)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.emerald_ore), new ItemStack(Items.emerald, Config.electroextractorOutput));
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, Config.eeOutput)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, Config.electroextractorOutput));
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.cobblestone, 1), new ItemStack(Blocks.sand, 2)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.cobblestone, 1), new ItemStack(Blocks.sand, 2));
ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4)); ElectroextractorRecipes.getInstance().addRecipe(new ItemStack(Blocks.sandstone, 1, Short.MAX_VALUE), new ItemStack(Blocks.sand, 4));
@ -275,19 +275,19 @@ public class MachineRecipes
static void parseElectroextractorRecipes() static void parseElectroextractorRecipes()
{ {
ArrayList<String> dustNames = ItemDust.getDusts(); ArrayList<String> dustNames = ItemDust.getDusts();
for (int i = 0; i < Config.eeOreDictInputs.length; i++) for (int i = 0; i < Config.electroextractorOreDictInputs.length; i++)
{ {
String[] entry = Config.eeOreDictInputs[i].split(":"); String[] entry = Config.electroextractorOreDictInputs[i].split(":");
if (doesOreNameExist(entry[0]) && doesOreNameExist(entry[0].replace("ore", "ingot"))) if (doesOreNameExist(entry[0]) && doesOreNameExist(entry[0].replace("ore", "ingot")))
{ {
List<ItemStack> ores = OreDictionary.getOres(entry[0]); List<ItemStack> ores = OreDictionary.getOres(entry[0]);
ItemDust.addDustType(entry[0].replace("ore", ""), Integer.parseInt(entry[1])); ItemDust.addDustType(entry[0].replace("ore", ""), Integer.parseInt(entry[1]));
for (int j = 0; j < ores.size(); j++) for (int j = 0; j < ores.size(); j++)
ElectroextractorRecipes.getInstance().addRecipe(ores.get(j), new ItemStack(LibItems.dusts, Config.eeOutput, dustNames.size() - 1)); ElectroextractorRecipes.getInstance().addRecipe(ores.get(j), new ItemStack(LibItems.dusts, Config.electroextractorOutput, dustNames.size() - 1));
} }
else else
{ {
LogHelper.warn("Your oreDictionary Entry " + Config.eeOreDictInputs[i] + " could not be registered."); LogHelper.warn("Your oreDictionary Entry " + Config.electroextractorOreDictInputs[i] + " could not be registered.");
if (!doesOreNameExist(entry[0])) if (!doesOreNameExist(entry[0]))
LogHelper.warn("This is because your oreDictionary Entry was not valid or registered as " + entry[0] + "."); LogHelper.warn("This is because your oreDictionary Entry was not valid or registered as " + entry[0] + ".");
else if (!doesOreNameExist(entry[0].replace("ore", "ingot"))) else if (!doesOreNameExist(entry[0].replace("ore", "ingot")))
@ -308,16 +308,16 @@ public class MachineRecipes
static void parseElectroextractorFuels() static void parseElectroextractorFuels()
{ {
for (int i = 0; i < Config.eeFuels.length; i++) for (int i = 0; i < Config.electroextractorFuels.length; i++)
try try
{ {
String[] parts = Config.eeFuels[i].split(":"); String[] parts = Config.electroextractorFuels[i].split(":");
if (parts.length == 2) if (parts.length == 2)
if (Config.findItemStack(parts[0], parts[1]) != null) if (Config.findItemStack(parts[0], parts[1]) != null)
TileElectroextractor.addFuel(Config.findItemStack(parts[0], parts[1])); TileElectroextractor.addFuel(Config.findItemStack(parts[0], parts[1]));
else else
{ {
LogHelper.warn("Item " + Config.eeFuels[i] + " could not be added to the Electroextractor's fuel list."); LogHelper.warn("Item " + Config.electroextractorFuels[i] + " could not be added to the Electroextractor's fuel list.");
LogHelper.warn("Please confirm you have the name and formatting correct."); LogHelper.warn("Please confirm you have the name and formatting correct.");
} }
@ -329,7 +329,7 @@ public class MachineRecipes
} }
else else
{ {
LogHelper.warn("Item " + Config.eeFuels[i] + " could not be added to the Electroextractor's fuel list."); LogHelper.warn("Item " + Config.electroextractorFuels[i] + " could not be added to the Electroextractor's fuel list.");
LogHelper.warn("Please confirm you have the name and formatting correct."); LogHelper.warn("Please confirm you have the name and formatting correct.");
} }
} }

View file

@ -25,7 +25,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class TileElectroextractor extends TileEntityLockable implements ITickable, ISidedInventory public class TileElectroextractor extends TileEntityLockable implements ITickable, ISidedInventory
{ {
private static int proTicks = Config.electroextractorProcessTime; private static int proTicks = Config.electroextractorProcessTime;
private static int qty = Config.eeOutput; private static int qty = Config.electroextractorOutput;
private static final int[] slotsTop = new int[] { 0 }; private static final int[] slotsTop = new int[] { 0 };
private static final int[] slotsBottom = new int[] { 2, 1 }; private static final int[] slotsBottom = new int[] { 2, 1 };
private static final int[] slotsSides = new int[] { 1 }; private static final int[] slotsSides = new int[] { 1 };