mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Added Mekanism Paxels
This commit is contained in:
parent
abb8e122d9
commit
854fdd1d0d
2 changed files with 59 additions and 18 deletions
|
@ -28,6 +28,8 @@ public enum ConfigBoolValues{
|
|||
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"),
|
||||
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_CANOLA_GEN("Canola Gen", ConfigCategories.WORLD_GEN, true, "If Canola should generate in the World"),
|
||||
|
|
|
@ -17,36 +17,75 @@ import java.util.List;
|
|||
|
||||
public class InitForeignPaxels{
|
||||
|
||||
private static Item[] foreignPaxels = new Item[9];
|
||||
private static final String[] names = new String[]{"Copper", "Tin", "Silver", "Lead", "Nickel", "Electrum", "Bronze", "Platinum", "Invar"};
|
||||
public static Item[] tfPaxels = new Item[9];
|
||||
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(){
|
||||
if(ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded("ThermalFoundation")){
|
||||
ModUtil.LOGGER.info("Initializing Thermal Foundation Material Paxels...");
|
||||
//MekanismTools
|
||||
if(ConfigBoolValues.MT_PAXELS.isEnabled()){
|
||||
if(Loader.isModLoaded("MekanismTools")){
|
||||
ModUtil.LOGGER.info("Initializing MekanismTools Material Paxels...");
|
||||
|
||||
for(int i = 0; i < foreignPaxels.length; i++){
|
||||
Item axe = ItemUtil.getItemFromName("ThermalFoundation:tool.axe"+names[i]);
|
||||
Item pickaxe = ItemUtil.getItemFromName("ThermalFoundation:tool.pickaxe"+names[i]);
|
||||
Item hoe = ItemUtil.getItemFromName("ThermalFoundation:tool.hoe"+names[i]);
|
||||
Item sword = ItemUtil.getItemFromName("ThermalFoundation:tool.sword"+names[i]);
|
||||
Item shovel = ItemUtil.getItemFromName("ThermalFoundation:tool.shovel"+names[i]);
|
||||
for(int i = 0; i < mtPaxels.length; i++){
|
||||
if(!(!ConfigBoolValues.DUPLICATE_PAXELS.isEnabled() && (i == 0 || (i == 3 && ConfigBoolValues.TF_PAXELS.isEnabled() && Loader.isModLoaded("ThermalFoundation"))))){
|
||||
Item axe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Axe");
|
||||
Item pickaxe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Pickaxe");
|
||||
Item hoe = ItemUtil.getItemFromName("MekanismTools:"+mtNames[i]+"Hoe");
|
||||
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){
|
||||
Item.ToolMaterial material = ((ItemTool)axe).func_150913_i();
|
||||
foreignPaxels[i] = new ItemAllToolAA(material, "ingot"+names[i], "paxel"+names[i], EnumRarity.rare);
|
||||
ItemUtil.register(foreignPaxels[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(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.");
|
||||
}
|
||||
}
|
||||
|
||||
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){
|
||||
item.getSubItems(item, CreativeTab.instance, list);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue