Added Mekanism Paxels

This commit is contained in:
Ellpeck 2015-07-12 22:57:36 +02:00
parent abb8e122d9
commit 854fdd1d0d
2 changed files with 59 additions and 18 deletions

View file

@ -28,6 +28,8 @@ public enum ConfigBoolValues{
DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"), DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"),
TF_PAXELS("Thermal Foundation Paxels", ConfigCategories.OTHER, true, "If Paxels made of Thermal Foundation Materials should exist"), TF_PAXELS("Thermal Foundation Paxels", ConfigCategories.OTHER, true, "If Paxels made of Thermal Foundation Materials should exist"),
MT_PAXELS("MekanismTools Paxels", ConfigCategories.OTHER, true, "If Paxels made of MekanismTools Materials should exist"),
DUPLICATE_PAXELS("Allow Duplicate Paxels", ConfigCategories.OTHER, true, "If Paxels are allowed to have Duplicates (for Example ActuallyAdditions' Obsidian and MekanismTools' Obsidian)"),
DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"), DO_RICE_GEN("Rice Gen", ConfigCategories.WORLD_GEN, true, "If Rice should generate in the World"),
DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"), DO_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"),

View file

@ -17,36 +17,75 @@ import java.util.List;
public class InitForeignPaxels{ public class InitForeignPaxels{
private static Item[] foreignPaxels = new Item[9]; public static Item[] tfPaxels = new Item[9];
private static final String[] names = new String[]{"Copper", "Tin", "Silver", "Lead", "Nickel", "Electrum", "Bronze", "Platinum", "Invar"}; private static final String[] tfNames = new String[]{"Copper", "Tin", "Silver", "Lead", "Nickel", "Electrum", "Bronze", "Platinum", "Invar"};
private static Item[] mtPaxels = new Item[6];
private static final String[] mtRepairNames = new String[]{"ingotRefinedObsidian", "gemLapis", "ingotOsmium", "ingotBronze", "ingotRefinedGlowstone", "ingotSteel"};
public static final String[] mtNames = new String[]{"Obsidian", "LapisLazuli", "Osmium", "Bronze", "Glowstone", "Steel"};
public static void init(){ public static void init(){
if(ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded("ThermalFoundation")){ //MekanismTools
ModUtil.LOGGER.info("Initializing Thermal Foundation Material Paxels..."); if(ConfigBoolValues.MT_PAXELS.isEnabled()){
if(Loader.isModLoaded("MekanismTools")){
ModUtil.LOGGER.info("Initializing MekanismTools Material Paxels...");
for(int i = 0; i < foreignPaxels.length; i++){ for(int i = 0; i < mtPaxels.length; i++){
Item axe = ItemUtil.getItemFromName("ThermalFoundation:tool.axe"+names[i]); if(!(!ConfigBoolValues.DUPLICATE_PAXELS.isEnabled() && (i == 0 || (i == 3 && ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded("ThermalFoundation"))))){
Item pickaxe = ItemUtil.getItemFromName("ThermalFoundation:tool.pickaxe"+names[i]); Item axe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Axe");
Item hoe = ItemUtil.getItemFromName("ThermalFoundation:tool.hoe"+names[i]); Item pickaxe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Pickaxe");
Item sword = ItemUtil.getItemFromName("ThermalFoundation:tool.sword"+names[i]); Item hoe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Hoe");
Item shovel = ItemUtil.getItemFromName("ThermalFoundation:tool.shovel"+names[i]); Item sword = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Sword");
Item shovel = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Shovel");
if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){
Item.ToolMaterial material = ((ItemTool)axe).func_150913_i(); Item.ToolMaterial material = ((ItemTool)axe).func_150913_i();
foreignPaxels[i] = new ItemAllToolAA(material, "ingot"+names[i], "paxel"+names[i], EnumRarity.rare); mtPaxels[i] = new ItemAllToolAA(material, mtRepairNames[i], "paxelMT"+mtNames[i], EnumRarity.rare);
ItemUtil.register(foreignPaxels[i]); ItemUtil.register(mtPaxels[i]);
if(ConfigCrafting.PAXELS.isEnabled()){ if(ConfigCrafting.PAXELS.isEnabled()){
GameRegistry.addRecipe(new ShapelessOreRecipe(foreignPaxels[i], axe, pickaxe, hoe, sword, shovel)); GameRegistry.addRecipe(new ShapelessOreRecipe(mtPaxels[i], axe, pickaxe, hoe, sword, shovel));
}
}
} }
} }
} }
else ModUtil.LOGGER.info("MekanismTools not loaded, can't initialize special Paxels.");
}
//Thermal Foundation
if(ConfigBoolValues.TF_PAXELS.isEnabled()){
if(Loader.isModLoaded("ThermalFoundation")){
ModUtil.LOGGER.info("Initializing Thermal Foundation Material Paxels...");
for(int i = 0; i < tfPaxels.length; i++){
Item axe = ItemUtil.getItemFromName("ThermalFoundation:tool.axe"+tfNames[i]);
Item pickaxe = ItemUtil.getItemFromName("ThermalFoundation:tool.pickaxe"+tfNames[i]);
Item hoe = ItemUtil.getItemFromName("ThermalFoundation:tool.hoe"+tfNames[i]);
Item sword = ItemUtil.getItemFromName("ThermalFoundation:tool.sword"+tfNames[i]);
Item shovel = ItemUtil.getItemFromName("ThermalFoundation:tool.shovel"+tfNames[i]);
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));
}
}
}
}
else ModUtil.LOGGER.info("Thermal Foundation not loaded, can't initialize special Paxels.");
} }
else ModUtil.LOGGER.info("Thermal Foundation not loaded, can't initialize special Paxels.");
} }
public static void addToCreativeTab(List list){ public static void addToCreativeTab(List list){
for(Item item : foreignPaxels){ for(Item item : tfPaxels){
if(item != null){
item.getSubItems(item, CreativeTab.instance, list);
}
}
for(Item item : mtPaxels){
if(item != null){ if(item != null){
item.getSubItems(item, CreativeTab.instance, list); item.getSubItems(item, CreativeTab.instance, list);
} }