2015-08-29 14:33:25 +02:00
|
|
|
|
/*
|
|
|
|
|
* This file ("InitForeignPaxels.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD> 2015 Ellpeck
|
|
|
|
|
*/
|
|
|
|
|
|
2015-07-12 22:05:34 +02:00
|
|
|
|
package ellpeck.actuallyadditions.items;
|
|
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
|
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
|
|
|
|
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
2015-09-10 21:25:34 +02:00
|
|
|
|
import ellpeck.actuallyadditions.crafting.ToolCrafting;
|
2015-07-12 22:05:34 +02:00
|
|
|
|
import ellpeck.actuallyadditions.creative.CreativeTab;
|
|
|
|
|
import ellpeck.actuallyadditions.items.tools.ItemAllToolAA;
|
|
|
|
|
import ellpeck.actuallyadditions.util.ItemUtil;
|
|
|
|
|
import ellpeck.actuallyadditions.util.ModUtil;
|
2015-09-10 21:25:34 +02:00
|
|
|
|
import ellpeck.actuallyadditions.util.Util;
|
2015-07-12 22:05:34 +02:00
|
|
|
|
import net.minecraft.item.EnumRarity;
|
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
import net.minecraft.item.ItemTool;
|
|
|
|
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
|
|
|
|
|
|
|
|
|
public class InitForeignPaxels{
|
|
|
|
|
|
2015-07-13 03:28:04 +02:00
|
|
|
|
private static final String THERMAL_FOUNDATION = "ThermalFoundation";
|
|
|
|
|
private static final String MEKANISM_TOOLS = "MekanismTools";
|
|
|
|
|
|
2015-07-12 22:57:36 +02:00
|
|
|
|
public static Item[] tfPaxels = new Item[9];
|
|
|
|
|
private static final String[] tfNames = new String[]{"Copper", "Tin", "Silver", "Lead", "Nickel", "Electrum", "Bronze", "Platinum", "Invar"};
|
2015-07-13 03:28:04 +02:00
|
|
|
|
|
2015-07-12 22:57:36 +02:00
|
|
|
|
private static Item[] mtPaxels = new Item[6];
|
|
|
|
|
public static final String[] mtNames = new String[]{"Obsidian", "LapisLazuli", "Osmium", "Bronze", "Glowstone", "Steel"};
|
2015-07-13 03:28:04 +02:00
|
|
|
|
private static final String[] mtRepairNames = new String[]{"ingotRefinedObsidian", "gemLapis", "ingotOsmium", "ingotBronze", "ingotRefinedGlowstone", "ingotSteel"};
|
2015-07-12 22:05:34 +02:00
|
|
|
|
|
|
|
|
|
public static void init(){
|
2015-07-12 22:57:36 +02:00
|
|
|
|
//MekanismTools
|
|
|
|
|
if(ConfigBoolValues.MT_PAXELS.isEnabled()){
|
2015-07-13 03:28:04 +02:00
|
|
|
|
if(Loader.isModLoaded(MEKANISM_TOOLS)){
|
|
|
|
|
ModUtil.LOGGER.info("Initializing "+MEKANISM_TOOLS+" AIOTs...");
|
2015-07-12 22:57:36 +02:00
|
|
|
|
|
|
|
|
|
for(int i = 0; i < mtPaxels.length; i++){
|
2015-07-13 03:28:04 +02:00
|
|
|
|
if(!(!ConfigBoolValues.DUPLICATE_PAXELS.isEnabled() && (i == 0 || (i == 3 && ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded(THERMAL_FOUNDATION))))){
|
|
|
|
|
Item axe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+mtNames[i]+"Axe");
|
|
|
|
|
Item pickaxe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+mtNames[i]+"Pickaxe");
|
|
|
|
|
Item hoe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+mtNames[i]+"Hoe");
|
|
|
|
|
Item sword = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+mtNames[i]+"Sword");
|
|
|
|
|
Item shovel = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+mtNames[i]+"Shovel");
|
2015-07-12 22:57:36 +02:00
|
|
|
|
|
|
|
|
|
if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){
|
|
|
|
|
Item.ToolMaterial material = ((ItemTool)axe).func_150913_i();
|
|
|
|
|
mtPaxels[i] = new ItemAllToolAA(material, mtRepairNames[i], "paxelMT"+mtNames[i], EnumRarity.rare);
|
|
|
|
|
ItemUtil.register(mtPaxels[i]);
|
|
|
|
|
|
|
|
|
|
if(ConfigCrafting.PAXELS.isEnabled()){
|
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(mtPaxels[i], axe, pickaxe, hoe, sword, shovel));
|
2015-09-10 21:25:34 +02:00
|
|
|
|
ToolCrafting.recipesPaxels.add(Util.lastIRecipe());
|
2015-07-12 22:57:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-07-12 22:05:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-10-02 16:48:01 +02:00
|
|
|
|
else{
|
|
|
|
|
ModUtil.LOGGER.info(MEKANISM_TOOLS+" not loaded, can't initialize Special AIOTs.");
|
|
|
|
|
}
|
2015-07-12 22:57:36 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Thermal Foundation
|
|
|
|
|
if(ConfigBoolValues.TF_PAXELS.isEnabled()){
|
2015-07-13 03:28:04 +02:00
|
|
|
|
if(Loader.isModLoaded(THERMAL_FOUNDATION)){
|
|
|
|
|
ModUtil.LOGGER.info("Initializing "+THERMAL_FOUNDATION+" AIOTs...");
|
2015-07-12 22:57:36 +02:00
|
|
|
|
|
|
|
|
|
for(int i = 0; i < tfPaxels.length; i++){
|
2015-07-13 03:28:04 +02:00
|
|
|
|
Item axe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.axe"+tfNames[i]);
|
|
|
|
|
Item pickaxe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.pickaxe"+tfNames[i]);
|
|
|
|
|
Item hoe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.hoe"+tfNames[i]);
|
|
|
|
|
Item sword = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.sword"+tfNames[i]);
|
|
|
|
|
Item shovel = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.shovel"+tfNames[i]);
|
2015-07-12 22:57:36 +02:00
|
|
|
|
|
|
|
|
|
if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){
|
|
|
|
|
Item.ToolMaterial material = ((ItemTool)axe).func_150913_i();
|
|
|
|
|
tfPaxels[i] = new ItemAllToolAA(material, "ingot"+tfNames[i], "paxelTF"+tfNames[i], EnumRarity.rare);
|
|
|
|
|
ItemUtil.register(tfPaxels[i]);
|
|
|
|
|
|
|
|
|
|
if(ConfigCrafting.PAXELS.isEnabled()){
|
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(tfPaxels[i], axe, pickaxe, hoe, sword, shovel));
|
2015-09-10 21:25:34 +02:00
|
|
|
|
ToolCrafting.recipesPaxels.add(Util.lastIRecipe());
|
2015-07-12 22:57:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-10-02 16:48:01 +02:00
|
|
|
|
else{
|
|
|
|
|
ModUtil.LOGGER.info(THERMAL_FOUNDATION+" not loaded, can't initialize Special AIOTs.");
|
|
|
|
|
}
|
2015-07-12 22:05:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-25 11:06:10 +02:00
|
|
|
|
public static void addToCreativeTab(){
|
2015-07-12 22:57:36 +02:00
|
|
|
|
for(Item item : tfPaxels){
|
|
|
|
|
if(item != null){
|
2015-07-25 11:06:10 +02:00
|
|
|
|
CreativeTab.instance.add(item);
|
2015-07-12 22:57:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(Item item : mtPaxels){
|
2015-07-12 22:05:34 +02:00
|
|
|
|
if(item != null){
|
2015-07-25 11:06:10 +02:00
|
|
|
|
CreativeTab.instance.add(item);
|
2015-07-12 22:05:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|