| |
| package fr.MrBlockTNT.NewOres; |
| |
| import net.minecraft.block.Block; |
| import net.minecraft.creativetab.CreativeTabs; |
| import net.minecraft.item.EnumArmorMaterial; |
| import net.minecraft.item.Item; |
| import net.minecraft.item.ItemStack; |
| import net.minecraft.stats.Achievement; |
| import net.minecraft.stats.AchievementList; |
| import net.minecraftforge.common.Configuration; |
| import net.minecraftforge.common.EnumHelper; |
| import net.minecraftforge.common.MinecraftForge; |
| import cpw.mods.fml.common.Mod; |
| import cpw.mods.fml.common.Mod.EventHandler; |
| import cpw.mods.fml.common.Mod.Instance; |
| import cpw.mods.fml.common.SidedProxy; |
| import cpw.mods.fml.common.event.FMLInitializationEvent; |
| import cpw.mods.fml.common.event.FMLPostInitializationEvent; |
| import cpw.mods.fml.common.event.FMLPreInitializationEvent; |
| import cpw.mods.fml.common.network.NetworkMod; |
| import cpw.mods.fml.common.registry.GameRegistry; |
| import fr.MrBlockTNT.proxy.CommonProxy; |
| |
| @Mod(modid = "NewOres", name = "New Ores", version = "1.0.0") |
| @NetworkMod(clientSideRequired = true, serverSideRequired = false) |
| |
| public class NewOres |
| { |
| @SidedProxy(clientSide = "fr.MrBlockTNT.proxy.ClientProxy", serverSide = "fr.MrBlockTNT.proxy.CommonProxy") |
| public static CommonProxy proxy; |
| |
| @Instance("NewOres") |
| public static NewOres instance; |
| |
| public static Block rubisOre, saphirOre, onyxOre, enchantiteOre, rubisBlock, saphirBlock, onyxBlock, enchantiteBlock; |
| |
| public static Item enchantiteDust, rubis, saphir, onyx, enchantite; |
| public static Item rubyBar, saphirBar, onyxBar, enchantiteBar; |
| public static Item rubyHelmet, rubyPlate, rubyLegs, rubyBoots; |
| public static Item saphirHelmet, saphirPlate, saphirLegs, saphirBoots; |
| public static Item onyxHelmet, onyxPlate, onyxLegs, onyxBoots; |
| public static Item enchantiteHelmet, enchantitePlate, enchantiteLegs, enchantiteBoots; |
| |
| public static int rubisOreID, saphirOreID, onyxOreID, enchantiteOreID, rubisBlockID, saphirBlockID, onyxBlockID, enchantiteBlockID, enchantiteDustID, rubisID, saphirID, onyxID, |
| enchantiteID, rubyBarID, saphirBarID, onyxBarID, enchantiteBarID, rubyHelmetID, rubyPlateID, rubyLegsID, rubyBootsID, saphirHelmetID, saphirPlateID, saphirLegsID, |
| saphirBootsID, onyxHelmetID, onyxPlateID, onyxLegsID, onyxBootsID, enchantiteHelmetID, enchantitePlateID, enchantiteLegsID, enchantiteBootsID; |
| |
| public static Achievement getEnchantiteDust; |
| |
| public static Achievement getEnchantite; |
| |
| public static Achievement getRuby; |
| |
| public static Achievement getSaphir; |
| |
| public static Achievement getOnyx; |
| |
| public static Achievement getEnchantiteArmor; |
| |
| static EnumArmorMaterial rubyMaterial = EnumHelper.addArmorMaterial("Ruby", 20, new int[]{2, 4, 3, 1}, 10); |
| static EnumArmorMaterial saphirMaterial = EnumHelper.addArmorMaterial("Saphirre", 25, new int[]{3, 5, 4, 2}, 8); |
| static EnumArmorMaterial onyxMaterial = EnumHelper.addArmorMaterial("Onyx", 35, new int[]{5, 9, 7, 4}, 9); |
| static EnumArmorMaterial enchantiteMaterial = EnumHelper.addArmorMaterial("Enchantite", 40, new int[]{9, 15, 13, 8}, 20); |
| |
| public static CreativeTabs NewOresTab = new NewOresTab("NewOres"); |
| |
| @EventHandler |
| public void PreInit(FMLPreInitializationEvent event) |
| { |
| |
| Configuration cfg = new Configuration(event.getSuggestedConfigurationFile()); |
| try |
| { |
| cfg.load(); |
| rubisOreID = cfg.getBlock("Ruby Ore", 2000).getInt(); |
| saphirOreID = cfg.getBlock("Saphir Ore", 2001).getInt(); |
| onyxOreID = cfg.getBlock("Onyx Ore", 2002).getInt(); |
| enchantiteOreID = cfg.getBlock("Enchantite Ore", 2003).getInt(); |
| rubisBlockID = cfg.getBlock("Ruby Block", 2006).getInt(); |
| saphirBlockID = cfg.getBlock("Saphirre Block", 2007).getInt(); |
| onyxBlockID = cfg.getBlock("Onyx Block", 2008).getInt(); |
| enchantiteBlockID = cfg.getBlock("Enchantite Block", 2009).getInt(); |
| enchantiteDustID = cfg.getItem("Enchantite Dust", 12000).getInt(); |
| rubisID = cfg.getItem("Ruby", 12001).getInt(); |
| saphirID = cfg.getItem("Saphirre", 12002).getInt(); |
| onyxID = cfg.getItem("Onyx", 12003).getInt(); |
| enchantiteBarID = cfg.getItem("Enchantite Ingot", 12004).getInt(); |
| rubyBarID = cfg.getItem("Ruby Ingot", 12005).getInt(); |
| saphirBarID = cfg.getItem("Saphirre Ingot", 12006).getInt(); |
| onyxBarID = cfg.getItem("Onyx Ingot", 12007).getInt(); |
| enchantiteID = cfg.getItem("Enchantite Gem", 12008).getInt(); |
| rubyHelmetID = cfg.getItem("Ruby Helmet", 12009).getInt(); |
| rubyPlateID = cfg.getItem("Ruby ChestPlate", 12010).getInt(); |
| rubyLegsID = cfg.getItem("Ruby Leggings", 12011).getInt(); |
| rubyBootsID = cfg.getItem("Ruby Boots", 12012).getInt(); |
| saphirHelmetID = cfg.getItem("Saphirre Helmet", 12013).getInt(); |
| saphirPlateID = cfg.getItem("Saphirre ChestPlate", 12014).getInt(); |
| saphirLegsID = cfg.getItem("Saphirre Leggings", 12015).getInt(); |
| saphirBootsID = cfg.getItem("Saphirre Boots", 12016).getInt(); |
| onyxHelmetID = cfg.getItem("Onyx Helmet", 12017).getInt(); |
| onyxPlateID = cfg.getItem("Onyx ChestPlate", 12018).getInt(); |
| onyxLegsID = cfg.getItem("Onyx Leggings", 12019).getInt(); |
| onyxBootsID = cfg.getItem("Onyx Boots", 12020).getInt(); |
| enchantiteHelmetID = cfg.getItem("Enchantite Helmet", 12021).getInt(); |
| enchantitePlateID = cfg.getItem("Enchantite ChestPlate", 12022).getInt(); |
| enchantiteLegsID = cfg.getItem("Enchantite Leggings", 12023).getInt(); |
| enchantiteBootsID = cfg.getItem("Enchantite Boots", 12024).getInt(); |
| } |
| catch(Exception ex) |
| { |
| event.getModLog().severe("Failed to load configuration"); |
| } |
| finally |
| { |
| if(cfg.hasChanged()) |
| { |
| cfg.save(); |
| } |
| } |
| |
| |
| rubisOre = new BlockRubyOre(rubisOreID).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Rubis Ore").setTextureName("newores:rubis_ore"); |
| saphirOre = new BlockSaphirreOre(saphirOreID).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Saphirre Ore").setTextureName("newores:saphir_ore"); |
| onyxOre = new BlockOnyxOre(onyxOreID).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Onyx Ore").setTextureName("newores:onyx_ore"); |
| enchantiteOre = new BlockEnchantiteOre(enchantiteOreID).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Enchantite Ore").setTextureName("newores:enchantite_ore"); |
| |
| |
| |
| rubisBlock = new BlockNewOre(2006).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Rubis Block").setTextureName("newores:rubis_block"); |
| saphirBlock = new BlockNewOre(2007).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Saphirre Block").setTextureName("newores:saphir_block"); |
| onyxBlock = new BlockNewOre(2008).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Onyx Block").setTextureName("newores:onyx_block"); |
| enchantiteBlock = new BlockNewOre(2009).setHardness(3.0F).setResistance(10.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Enchantite Block").setTextureName("newores:enchantite_block"); |
| |
| GameRegistry.registerBlock(rubisOre, "Minerai de Rubis"); |
| GameRegistry.registerBlock(saphirOre, "Minerai de Saphir"); |
| GameRegistry.registerBlock(onyxOre, "Minerai d'Onyx"); |
| GameRegistry.registerBlock(enchantiteOre, "Minerai d'Enchantite"); |
| |
| |
| |
| GameRegistry.registerBlock(rubisBlock, "Bloc de Rubis"); |
| GameRegistry.registerBlock(saphirBlock, "Bloc de Saphir"); |
| GameRegistry.registerBlock(onyxBlock, "Bloc d'Onyx"); |
| GameRegistry.registerBlock(enchantiteBlock, "Bloc d'Enchantite"); |
| |
| MinecraftForge.setBlockHarvestLevel(rubisOre, "pickaxe", 3); |
| MinecraftForge.setBlockHarvestLevel(saphirOre, "pickaxe", 3); |
| MinecraftForge.setBlockHarvestLevel(onyxOre, "pickaxe", 3); |
| MinecraftForge.setBlockHarvestLevel(enchantiteOre, "pickaxe", 4); |
| |
| enchantiteDust = new ItemNewOres(12000).setUnlocalizedName("Enchantite Dust").setTextureName("newores:enchantite_dust"); |
| rubis = new ItemNewOres(12001).setUnlocalizedName("Rubis Gem").setTextureName("newores:rubis"); |
| saphir = new ItemNewOres(12002).setUnlocalizedName("Saphir Gem").setTextureName("newores:saphir"); |
| onyx = new ItemNewOres(12003).setUnlocalizedName("Onyx Gem").setTextureName("newores:onyx"); |
| enchantiteBar = new ItemNewOres(12004).setUnlocalizedName("Enchantite Bar").setTextureName("newores:enchantite_ingot"); |
| rubyBar = new ItemNewOres(12005).setUnlocalizedName("Rubis Bar").setTextureName("newores:rubis_ingot"); |
| saphirBar = new ItemNewOres(12006).setUnlocalizedName("Saphir Bar").setTextureName("newores:saphir_ingot"); |
| onyxBar = new ItemNewOres(12007).setUnlocalizedName("Onyx Bar").setTextureName("newores:onyx_ingot"); |
| enchantite = new ItemNewOres(12008).setUnlocalizedName("Enchantite Gem").setTextureName("newores:enchantite"); |
| |
| GameRegistry.registerItem(enchantiteDust, "EnchantiteDust", "NewOres"); |
| GameRegistry.registerItem(rubis, "Ruby", "NewOres"); |
| GameRegistry.registerItem(saphir, "Saphirre", "NewOres"); |
| GameRegistry.registerItem(onyx, "Onyx", "NewOres"); |
| GameRegistry.registerItem(enchantiteBar, "Enchantite Bar", "NewOres"); |
| GameRegistry.registerItem(rubyBar, "Ruby Bar", "NewOres"); |
| GameRegistry.registerItem(saphirBar, "Saphirre Bar", "NewOres"); |
| GameRegistry.registerItem(onyxBar, "Onyx Bar", "NewOres"); |
| GameRegistry.registerItem(enchantite, "EnchantiteGem", "NewOres"); |
| |
| |
| rubyHelmet = new RubyArmor(12100, rubyMaterial, 0,0).setUnlocalizedName("RubyHelmet").setTextureName("newores:rubis_helmet"); |
| rubyPlate = new RubyArmor(12101, rubyMaterial, 0, 1).setUnlocalizedName("RubyPlate").setTextureName("newores:rubis_chestplate"); |
| rubyLegs = new RubyArmor(12102, rubyMaterial, 0, 2).setUnlocalizedName("RubyLegs").setTextureName("newores:rubis_leggings"); |
| rubyBoots = new RubyArmor(12103, rubyMaterial, 0, 3).setUnlocalizedName("RubyBoots").setTextureName("newores:rubis_boots"); |
| |
| saphirHelmet = new SaphirreArmor(12104, saphirMaterial, 0, 0).setUnlocalizedName("SaphirreHelmet").setTextureName("newores:saphir_helmet"); |
| saphirPlate = new SaphirreArmor(12105, saphirMaterial, 0, 1).setUnlocalizedName("SaphirrePlate").setTextureName("newores:saphir_chestplate"); |
| saphirLegs = new SaphirreArmor(12106, saphirMaterial, 0, 2).setUnlocalizedName("SaphirreLegs").setTextureName("newores:saphir_leggings"); |
| saphirBoots = new SaphirreArmor(12107, saphirMaterial, 0, 3).setUnlocalizedName("SaphirreBoots").setTextureName("newores:saphir_boots"); |
| |
| onyxHelmet = new OnyxArmor(12108, onyxMaterial, 0, 0).setUnlocalizedName("OnyxHelmet").setTextureName("newores:onyx_helmet"); |
| onyxPlate = new OnyxArmor(12109, onyxMaterial, 0, 1).setUnlocalizedName("OnyxPlate").setTextureName("newores:onyx_chestplate"); |
| onyxLegs = new OnyxArmor(12110, onyxMaterial, 0, 2).setUnlocalizedName("OnyxLegs").setTextureName("newores:onyx_leggings"); |
| onyxBoots = new OnyxArmor(12111, onyxMaterial, 0, 3).setUnlocalizedName("OnyxBoots").setTextureName("newores:onyx_boots"); |
| |
| enchantiteHelmet = new EnchantiteArmor(12112, enchantiteMaterial, 0, 0).setUnlocalizedName("EnchantiteHelmet").setTextureName("newores:enchantite_helmet"); |
| enchantitePlate = new EnchantiteArmor(12113, enchantiteMaterial, 0, 1).setUnlocalizedName("EnchantitePlate").setTextureName("newores:enchantite_chestplate"); |
| enchantiteLegs = new EnchantiteArmor(12114, enchantiteMaterial, 0, 2).setUnlocalizedName("EnchantiteLegs").setTextureName("newores:enchantite_leggings"); |
| enchantiteBoots = new EnchantiteArmor(12115, enchantiteMaterial, 0, 3).setUnlocalizedName("EnchantiteBoots").setTextureName("newores:enchantite_boots"); |
| |
| GameRegistry.registerItem(rubyHelmet, "RubyHelmet", "NewOres"); |
| GameRegistry.registerItem(rubyPlate, "RubyPlate", "NewOres"); |
| GameRegistry.registerItem(rubyLegs, "RubyLegs", "NewOres"); |
| GameRegistry.registerItem(rubyBoots, "RubyBoots", "NewOres"); |
| |
| GameRegistry.registerItem(saphirHelmet, "SaphirreHelmet", "NewOres"); |
| GameRegistry.registerItem(saphirPlate, "SaphirrePlate", "NewOres"); |
| GameRegistry.registerItem(saphirLegs, "SaphirreLegs", "NewOres"); |
| GameRegistry.registerItem(saphirBoots, "SaphirreBoots", "NewOres"); |
| |
| GameRegistry.registerItem(onyxHelmet, "OnyxHelmet", "NewOres"); |
| GameRegistry.registerItem(onyxPlate, "OnyxPlate", "NewOres"); |
| GameRegistry.registerItem(onyxLegs, "OnyxLegs", "NewOres"); |
| GameRegistry.registerItem(onyxBoots, "OnyxBoots", "NewOres"); |
| |
| GameRegistry.registerItem(enchantiteHelmet, "EnchantiteHelmet", "NewOres"); |
| GameRegistry.registerItem(enchantitePlate, "EnchantitePlate", "NewOres"); |
| GameRegistry.registerItem(enchantiteLegs, "EnchantiteLegs", "NewOres"); |
| GameRegistry.registerItem(enchantiteBoots, "EnchantiteBoots", "NewOres"); |
| |
| |
| GameRegistry.registerWorldGenerator(new NewOresGenerator()); |
| |
| |
| |
| GameRegistry.addRecipe(new ItemStack(rubyHelmet), new Object[]{"XXX", "X X", 'X', NewOres.rubis}); |
| GameRegistry.addRecipe(new ItemStack(rubyPlate), new Object[]{"X X", "XXX", "XXX", 'X', NewOres.rubis}); |
| GameRegistry.addRecipe(new ItemStack(rubyLegs), new Object[]{"XXX", "X X", "X X", 'X', NewOres.rubis}); |
| GameRegistry.addRecipe(new ItemStack(rubyBoots), new Object[]{"X X", "X X", 'X', NewOres.rubis}); |
| GameRegistry.addRecipe(new ItemStack(saphirHelmet), new Object[]{"XXX", "X X", 'X', NewOres.saphir}); |
| GameRegistry.addRecipe(new ItemStack(saphirPlate), new Object[]{"X X", "XXX", "XXX", 'X', NewOres.saphir}); |
| GameRegistry.addRecipe(new ItemStack(saphirLegs), new Object[]{"XXX", "X X", "X X", 'X', NewOres.saphir}); |
| GameRegistry.addRecipe(new ItemStack(saphirBoots), new Object[]{"X X", "X X", 'X', NewOres.saphir}); |
| GameRegistry.addRecipe(new ItemStack(onyxHelmet), new Object[]{"XXX", "X X", 'X', NewOres.onyx}); |
| GameRegistry.addRecipe(new ItemStack(onyxPlate), new Object[]{"X X", "XXX", "XXX", 'X', NewOres.onyx}); |
| GameRegistry.addRecipe(new ItemStack(onyxLegs), new Object[]{"XXX", "X X", "X X", 'X', NewOres.onyx}); |
| GameRegistry.addRecipe(new ItemStack(onyxBoots), new Object[]{"X X", "X X", 'X', NewOres.onyx}); |
| GameRegistry.addRecipe(new ItemStack(enchantiteHelmet), new Object[]{"XXX", "X X", 'X', NewOres.enchantite}); |
| GameRegistry.addRecipe(new ItemStack(enchantitePlate), new Object[]{"X X", "XXX", "XXX", 'X', NewOres.enchantite}); |
| GameRegistry.addRecipe(new ItemStack(enchantiteLegs), new Object[]{"XXX", "X X", "X X", 'X', NewOres.enchantite}); |
| GameRegistry.addRecipe(new ItemStack(enchantiteBoots), new Object[]{"X X", "X X", 'X', NewOres.enchantite}); |
| |
| |
| GameRegistry.addRecipe(new ItemStack(rubyBar), new Object[]{"XX", 'X', NewOres.rubis}); |
| GameRegistry.addRecipe(new ItemStack(saphirBar), new Object[]{"XX", 'X',NewOres.saphir}); |
| GameRegistry.addRecipe(new ItemStack(onyxBar), new Object[]{"XX",'X', NewOres.onyx}); |
| GameRegistry.addRecipe(new ItemStack(enchantiteBar), new Object[]{"XX",'X', NewOres.enchantite}); |
| GameRegistry.addRecipe(new ItemStack(enchantite), new Object[]{"XYX", "AZA", "XYX", 'X', NewOres.rubyBar, 'Y', NewOres.saphirBar, 'Z', NewOres.enchantite, 'A', NewOres.onyxBar}); |
| |
| |
| getRuby = new Achievement(2000, "getRuby", -2, 0, rubis, AchievementList.openInventory).registerAchievement(); |
| getSaphir = new Achievement(2001, "getSaphir", -2, -2, saphir, getRuby).registerAchievement(); |
| getOnyx = new Achievement(2002, "getOnyx", -4, -2, onyx, getSaphir).registerAchievement(); |
| getEnchantiteDust = new Achievement(2003, "getEDust", -6, -2, enchantiteDust, getOnyx).registerAchievement(); |
| } |
| |
| @EventHandler |
| public void Init(FMLInitializationEvent event) |
| { |
| proxy.registerRender(); |
| } |
| |
| @EventHandler |
| public void PostInit(FMLPostInitializationEvent event) |
| { |
| |
| } |
| } |
| |