commit 14d8eb4679ce0cae20dfd28d567e49dca4d59bbe parent 1185c196fa0ecbbb69afbe59ecf4a9393d468ff5 Author: Marcel Radzio <marcel@radzio-sh.de> Date: Wed, 26 Mar 2014 19:27:53 +0100 Add source Add source of 1.6.4_version Diffstat:
19 files changed, 796 insertions(+), 0 deletions(-)
diff --git a/assets/startreckmod/textures/blocks/3000.png b/assets/startreckmod/textures/blocks/3000.png Binary files differ. diff --git a/assets/startreckmod/textures/items/3456.png b/assets/startreckmod/textures/items/3456.png Binary files differ. diff --git a/assets/startreckmod/textures/items/3457.png b/assets/startreckmod/textures/items/3457.png Binary files differ. diff --git a/assets/startreckmod/textures/items/3458.png b/assets/startreckmod/textures/items/3458.png Binary files differ. diff --git a/assets/startreckmod/textures/items/3459.png b/assets/startreckmod/textures/items/3459.png Binary files differ. diff --git a/mtrnord/StarTreckMod/Blocks.java b/mtrnord/StarTreckMod/Blocks.java @@ -0,0 +1,28 @@ +package mtrnord.StarTreckMod; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; + +public class Blocks extends Block{ + + public Blocks(int id, Material mat) { + super(id, mat); + } + + @Override + public void registerIcons(IconRegister reg){ + this.blockIcon = reg.registerIcon("startreckmod:" + this.blockID); + + } + + public int idDropped(int i, Random rand, int j){ + return this.blockID; + } + + + + +} diff --git a/mtrnord/StarTreckMod/EnumToolMaterialStarTreck.java b/mtrnord/StarTreckMod/EnumToolMaterialStarTreck.java @@ -0,0 +1,106 @@ +package mtrnord.StarTreckMod; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; + +public enum EnumToolMaterialStarTreck +{ + WOOD(0, 59, 2.0F, 0.0F, 15), + STONE(1, 131, 4.0F, 1.0F, 5), + IRON(2, 250, 6.0F, 2.0F, 14), + EMERALD(3, 1561, 8.0F, 3.0F, 10), + GOLD(0, 32, 12.0F, 0.0F, 22), + TITANIUM(5, 6000, 16.0F, 10.0F, 22); + + /** + * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) + */ + private final int harvestLevel; + + /** + * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) + */ + private final int maxUses; + + /** + * The strength of this tool material against blocks which it is effective against. + */ + private final float efficiencyOnProperMaterial; + + /** Damage versus entities. */ + private final float damageVsEntity; + + /** Defines the natural enchantability factor of the material. */ + private final int enchantability; + + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; + + private EnumToolMaterialStarTreck(int par3, int par4, float par5, float par6, int par7) + { + this.harvestLevel = par3; + this.maxUses = par4; + this.efficiencyOnProperMaterial = par5; + this.damageVsEntity = par6; + this.enchantability = par7; + } + + /** + * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) + */ + public int getMaxUses() + { + return this.maxUses; + } + + /** + * The strength of this tool material against blocks which it is effective against. + */ + public float getEfficiencyOnProperMaterial() + { + return this.efficiencyOnProperMaterial; + } + + /** + * Damage versus entities. + */ + public float getDamageVsEntity() + { + return this.damageVsEntity; + } + + /** + * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) + */ + public int getHarvestLevel() + { + return this.harvestLevel; + } + + /** + * Return the natural enchantability factor of the material. + */ + public int getEnchantability() + { + return this.enchantability; + } + + /** + * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool + * with an anvil + */ + public int getToolCraftingMaterial() + { + + switch (this) + { + case WOOD: return Block.planks.blockID; + case STONE: return Block.cobblestone.blockID; + case GOLD: return Item.ingotGold.itemID; + case IRON: return Item.ingotIron.itemID; + case EMERALD: return Item.diamond.itemID; + case TITANIUM: return StarTreckMod.titaniumIngotID; + default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.itemID); + } + } +} diff --git a/mtrnord/StarTreckMod/Generator.java b/mtrnord/StarTreckMod/Generator.java @@ -0,0 +1,45 @@ +package mtrnord.StarTreckMod; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenMinable; +import cpw.mods.fml.common.IWorldGenerator; + +public class Generator implements IWorldGenerator{ + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { + switch(world.provider.dimensionId){ + case -1: + generateNether(world, random, chunkX * 16, chunkZ * 16); + break; + case 0: + generateSurface(world, random, chunkX * 16, chunkZ * 16); + break; + case 1: + generateEnd(world, random, chunkX * 16, chunkZ * 16); + break; + } + } + + private void generateEnd(World world, Random random, int i, int j) {} + + private void generateSurface(World world, Random random, int i, int j) { + + for(int k = 0; k < 10; k++) { + int XCoord = i + random.nextInt(16); + int YCoord = random.nextInt(64); + int ZCoord = j + random.nextInt(16); + + (new WorldGenMinable(StarTreckMod.titaniumOre.blockID, 0)).generate(world, random, XCoord, YCoord, ZCoord); + } + } + + private void generateNether(World world, Random random, int i, int j) {} +} + + + diff --git a/mtrnord/StarTreckMod/ItemAxeStarTreckMod.java b/mtrnord/StarTreckMod/ItemAxeStarTreckMod.java @@ -0,0 +1,25 @@ +package mtrnord.StarTreckMod; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; + +public class ItemAxeStarTreckMod extends ItemToolStarTreckMod +{ + /** an array of the blocks this axe is effective against */ + public static final Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern}; + + public ItemAxeStarTreckMod(int par1, EnumToolMaterialStarTreck par2EnumToolMaterial) + { + super(par1, 3.0F, par2EnumToolMaterial, blocksEffectiveAgainst); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + return par2Block != null && (par2Block.blockMaterial == Material.wood || par2Block.blockMaterial == Material.plants || par2Block.blockMaterial == Material.vine) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); + } +} diff --git a/mtrnord/StarTreckMod/ItemPickaxeStarTreckMod.java b/mtrnord/StarTreckMod/ItemPickaxeStarTreckMod.java @@ -0,0 +1,36 @@ +package mtrnord.StarTreckMod; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; + +public class ItemPickaxeStarTreckMod extends ItemToolStarTreckMod +{ + /** an array of the blocks this pickaxe is effective against */ + public static final Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; + + public ItemPickaxeStarTreckMod(int par1, EnumToolMaterialStarTreck par2EnumToolMaterial) + { + super(par1, 2.0F, par2EnumToolMaterial, blocksEffectiveAgainst); + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockIron && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); + } +} + diff --git a/mtrnord/StarTreckMod/ItemShovelStarTreckMod.java b/mtrnord/StarTreckMod/ItemShovelStarTreckMod.java @@ -0,0 +1,23 @@ +package mtrnord.StarTreckMod; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemTool; + +public class ItemShovelStarTreckMod extends ItemToolStarTreckMod +{ + /** an array of the blocks this spade is effective against */ + public static final Block[] blocksEffectiveAgainst = new Block[] {Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; + + public ItemShovelStarTreckMod(int par1, EnumToolMaterialStarTreck par2EnumToolMaterial) + { + super(par1, 1.0F, par2EnumToolMaterial, blocksEffectiveAgainst); + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + return par1Block == Block.snow ? true : par1Block == Block.blockSnow; + } +} diff --git a/mtrnord/StarTreckMod/ItemToolStarTreckMod.java b/mtrnord/StarTreckMod/ItemToolStarTreckMod.java @@ -0,0 +1,131 @@ +package mtrnord.StarTreckMod; + +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; + +public class ItemToolStarTreckMod extends Item +{ + /** Array of blocks the tool has extra effect against. */ + private Block[] blocksEffectiveAgainst; + public float efficiencyOnProperMaterial = 4.0F; + + /** Damage versus entities. */ + public float damageVsEntity; + + /** The material this tool is made from. */ + protected EnumToolMaterialStarTreck toolMaterial; + + protected ItemToolStarTreckMod(int par1, float par2, EnumToolMaterialStarTreck par3EnumToolMaterial, Block[] par4ArrayOfBlock) + { + super(par1); + this.toolMaterial = par3EnumToolMaterial; + this.blocksEffectiveAgainst = par4ArrayOfBlock; + this.maxStackSize = 1; + this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); + this.efficiencyOnProperMaterial = par3EnumToolMaterial.getEfficiencyOnProperMaterial(); + this.damageVsEntity = par2 + par3EnumToolMaterial.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + for (int i = 0; i < this.blocksEffectiveAgainst.length; ++i) + { + if (this.blocksEffectiveAgainst[i] == par2Block) + { + return this.efficiencyOnProperMaterial; + } + } + + return 1.0F; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) + { + par1ItemStack.damageItem(2, par3EntityLivingBase); + return true; + } + + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) + { + if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) + { + par1ItemStack.damageItem(1, par7EntityLivingBase); + } + + return true; + } + + @SideOnly(Side.CLIENT) + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return this.toolMaterial.getEnchantability(); + } + + /** + * Return the name for this tool's material. + */ + public String getToolMaterialName() + { + return this.toolMaterial.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0)); + return multimap; + } + + /** FORGE: Overridden to allow custom tool effectiveness */ + @Override + public float getStrVsBlock(ItemStack stack, Block block, int meta) + { + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return efficiencyOnProperMaterial; + } + return getStrVsBlock(stack, block); + } +} diff --git a/mtrnord/StarTreckMod/Items.java b/mtrnord/StarTreckMod/Items.java @@ -0,0 +1,19 @@ +package mtrnord.StarTreckMod; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.Item; + +public class Items extends Item{ + + public Items(int id) { + super(id); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister reg){ + this.itemIcon = reg.registerIcon("startreckmod:" + this.itemID); + } + +} diff --git a/mtrnord/StarTreckMod/Proxies/StarTreckModClientProxy.java b/mtrnord/StarTreckMod/Proxies/StarTreckModClientProxy.java @@ -0,0 +1,7 @@ +package mtrnord.StarTreckMod.Proxies; + +import mtrnord.StarTreckMod.Proxies.StarTreckModCommonProxy; + +public class StarTreckModClientProxy extends StarTreckModCommonProxy{ + +} diff --git a/mtrnord/StarTreckMod/Proxies/StarTreckModCommonProxy.java b/mtrnord/StarTreckMod/Proxies/StarTreckModCommonProxy.java @@ -0,0 +1,5 @@ +package mtrnord.StarTreckMod.Proxies; + +public class StarTreckModCommonProxy { + +} diff --git a/mtrnord/StarTreckMod/StarTreckItemAxe.java b/mtrnord/StarTreckMod/StarTreckItemAxe.java @@ -0,0 +1,19 @@ +package mtrnord.StarTreckMod; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemSpade; + +public class StarTreckItemAxe extends ItemAxeStarTreckMod{ + + public StarTreckItemAxe(int ID, EnumToolMaterialStarTreck material) { + super(ID, material); + + } + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister reg){ + this.itemIcon = reg.registerIcon("startreckmod:" + this.itemID); + } +} diff --git a/mtrnord/StarTreckMod/StarTreckItemPickaxe.java b/mtrnord/StarTreckMod/StarTreckItemPickaxe.java @@ -0,0 +1,21 @@ +package mtrnord.StarTreckMod; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemPickaxe; + +public class StarTreckItemPickaxe extends ItemPickaxeStarTreckMod{ + + public StarTreckItemPickaxe(int ID, EnumToolMaterialStarTreck material) { + super(ID, material); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister reg){ + this.itemIcon = reg.registerIcon("startreckmod:" + this.itemID); + } + + +} diff --git a/mtrnord/StarTreckMod/StarTreckItemShovel.java b/mtrnord/StarTreckMod/StarTreckItemShovel.java @@ -0,0 +1,19 @@ +package mtrnord.StarTreckMod; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.item.EnumToolMaterial; +import net.minecraft.item.ItemSpade; + +public class StarTreckItemShovel extends ItemShovelStarTreckMod{ + + public StarTreckItemShovel(int ID, EnumToolMaterialStarTreck material) { + super(ID, material); + + } + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister reg){ + this.itemIcon = reg.registerIcon("startreckmod:" + this.itemID); + } +} diff --git a/mtrnord/StarTreckMod/StarTreckMod.java b/mtrnord/StarTreckMod/StarTreckMod.java @@ -0,0 +1,312 @@ +package mtrnord.StarTreckMod; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import mtrnord.StarTreckMod.Proxies.StarTreckModCommonProxy; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.Init; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.PostInit; +import cpw.mods.fml.common.Mod.PreInit; +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 cpw.mods.fml.common.registry.LanguageRegistry; +import net.minecraftforge.common.Configuration; + +@Mod(modid = "startreckmod", name = "The StarTreck modification", version = "0.2") +@NetworkMod(clientSideRequired = true, serverSideRequired = false) +public class StarTreckMod { + + + + //CONFIG_VARIABLEN + int titaniumBlockConfigID; + int titaniumPouderConfigID; + String titaniumBlockName; + String titaniumPouderName; + int titaniumIngotConfigID; + String titaniumIngotName; + int cutterConfigID; + String cutterName; + int titaniumStickConfigID; + String titaniumStickName; + int titaniumShovelConfigID; + String titaniumShovelName; + int titaniumPickaxeConfigID; + String titaniumPickaxeName; + int titaniumAxeConfigID; + String titaniumAxeName; + + + + @Instance("StartTreckMod") + public static StarTreckMod instance; + + @SidedProxy(clientSide="mtrnord.StarTreckMod.Proxies.StarTreckModClientProxy", serverSide="mtrnord.StarTreckMod.Proxies.StarTreckModCommonProxy") + public static StarTreckModCommonProxy proxy; + + //--------------------------------------------------- + + public static Item titaniumPouder; + public int titaniumPouderID = 3200; + + public static Item titaniumIngot; + public static int titaniumIngotID = 3201; + + public static Item cutter; + public int cutterID = 3202; + + + public static Item titaniumStick; + public int titaniumStickID = 3203; + + //--------------------------------------------------- + + public static Block titaniumOre; + public int titaniumOreID = 3000; + + //--------------------------------------------------- + + public static ItemPickaxeStarTreckMod titaniumPickaxe; + public int titaniumPickaxeID = 3205; + + //---------------------------------------------------- + + public static ItemShovelStarTreckMod titaniumShovel; + public int titaniumShovelID = 3204; + + + //---------------------------------------------------- + + public static ItemAxeStarTreckMod titaniumAxe; + public int titaniumAxeID = 3206; + + //---------------------------------------------------- + + public static CreativeTabs StarTreckBlocks = new CreativeTabs("StarTreckBlocks"){ + public ItemStack getIconItemStack(){ + return new ItemStack(titaniumOre, 1, 0); + } + }; + + public static CreativeTabs StarTreckDrops = new CreativeTabs("StarTreckDrops"){ + public ItemStack getIconItemStack(){ + return new ItemStack(titaniumPouder, 1, 0); + } + }; + + public static CreativeTabs StarTreckIngots = new CreativeTabs("StarTreckIngots"){ + public ItemStack getIconItemStack(){ + return new ItemStack(titaniumIngot, 1, 0); + } + }; + + public static CreativeTabs StarTreckTools = new CreativeTabs("StarTreckTools"){ + public ItemStack getIconItemStack(){ + return new ItemStack(titaniumPickaxe, 1, 0); + } + }; + + //--------------------------------------------------- + + + + @PreInit + public void preInit(FMLPreInitializationEvent event) { + + Configuration config = new Configuration(event.getSuggestedConfigurationFile()); + + config.load(); + + //-------------------- + // titaniumBlock + //-------------------- + + titaniumBlockName = config.get(Configuration.CATEGORY_BLOCK, "titaniumBlockName", "Titanium Ore").getString(); + titaniumOreID = config.get(Configuration.CATEGORY_BLOCK, "titaniumBlockConfigID", 3000).getInt(); + + //-------------------- + // titaniumPouder + //-------------------- + + titaniumPouderName = config.get(Configuration.CATEGORY_ITEM, "titaniumPouderName", "Titanium Pouder").getString(); + titaniumPouderID = config.get(Configuration.CATEGORY_ITEM, "titaniumPouderConfigID", 3200).getInt(); + + //-------------------- + // titaniumIngot + //-------------------- + + titaniumIngotName = config.get(Configuration.CATEGORY_ITEM, "titaniumIngotName", "Titanium Ingot").getString(); + titaniumIngotID = config.get(Configuration.CATEGORY_ITEM, "titaniumIngotConfigID", 3201).getInt(); + + //-------------------- + // Cutter + //-------------------- + + cutterName = config.get(Configuration.CATEGORY_ITEM, "titaniumCutterName", "Cutter").getString(); + cutterID = config.get(Configuration.CATEGORY_ITEM, "titaniumCutterConfigID", 3202).getInt(); + + //-------------------- + // titaniumShovel + //-------------------- + + titaniumShovelName = config.get(Configuration.CATEGORY_ITEM, "titaniumShovelName", "Titanium Shovel").getString(); + titaniumShovelID = config.get(Configuration.CATEGORY_ITEM, "titaniumShovelConfigID", 3204).getInt(); + + //-------------------- + // titaniumPickaxe + //-------------------- + + titaniumPickaxeName = config.get(Configuration.CATEGORY_ITEM, "titaniumPickaxeName", "Titanium Pickaxe").getString(); + titaniumPickaxeID = config.get(Configuration.CATEGORY_ITEM, "titaniumPickaxeConfigID", 3205).getInt(); + + //-------------------- + // titaniumAxe + //-------------------- + + titaniumAxeName = config.get(Configuration.CATEGORY_ITEM, "titaniumAxeName", "Titanium Axe").getString(); + titaniumAxeID = config.get(Configuration.CATEGORY_ITEM, "titaniumAxeConfigID", 3206).getInt(); + + //-------------------- + // titaniumStick + //-------------------- + + titaniumStickName = config.get(Configuration.CATEGORY_ITEM, "titaniumStickName", "Titanium Stick").getString(); + titaniumStickID = config.get(Configuration.CATEGORY_ITEM, "titaniumStickConfigID", 3203).getInt(); + + + + config.save(); + + + } + + @Init + public void init(FMLInitializationEvent event) { + + titaniumPouder = new Items(titaniumPouderID).setUnlocalizedName("titaniumPouder").setCreativeTab(StarTreckDrops); + titaniumIngot = new Items(titaniumIngotID).setUnlocalizedName("titaniumIngot").setCreativeTab(StarTreckIngots); + cutter = new Items(cutterID).setUnlocalizedName("cutter").setCreativeTab(StarTreckTools); + titaniumStick = new Items(titaniumStickID).setUnlocalizedName("titaniumStick").setCreativeTab(StarTreckTools); + titaniumPickaxe = (ItemPickaxeStarTreckMod) new ItemPickaxeStarTreckMod(titaniumPickaxeID, EnumToolMaterialStarTreck.TITANIUM).setUnlocalizedName(titaniumPickaxeName).setCreativeTab(StarTreckTools); + titaniumShovel = (ItemShovelStarTreckMod) new ItemShovelStarTreckMod(titaniumShovelID, EnumToolMaterialStarTreck.TITANIUM).setUnlocalizedName(titaniumShovelName).setCreativeTab(StarTreckTools); + titaniumAxe = (ItemAxeStarTreckMod) new ItemAxeStarTreckMod(titaniumAxeID, EnumToolMaterialStarTreck.TITANIUM).setUnlocalizedName(titaniumAxeName).setCreativeTab(StarTreckTools); + + + + titaniumOre = new Blocks(titaniumOreID, Material.rock).setCreativeTab(StarTreckBlocks).setLightValue(0.02F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("titaniumOre").setResistance(5.0F); + + initCraftingRecipes(); + registerItems(); + registerBlocks(); + updateLanguage(); + GameRegistry.registerWorldGenerator(new Generator()); + InitSmeltingRecipes(); + + + } + + @PostInit + public static void postInit(FMLPostInitializationEvent event) { + + } + + + private void registerBlocks(){ + GameRegistry.registerBlock(titaniumOre, "Titanium Ore"); + } + private void updateLanguage(){ + LanguageRegistry.addName(titaniumOre, titaniumBlockName); + LanguageRegistry.addName(titaniumPouder, titaniumPouderName); + LanguageRegistry.addName(titaniumIngot, titaniumIngotName); + LanguageRegistry.addName(cutter, cutterName); + LanguageRegistry.addName(titaniumStick, titaniumStickName); + LanguageRegistry.addName(titaniumShovel, titaniumShovelName); + LanguageRegistry.addName(titaniumPickaxe, titaniumPickaxeName); + LanguageRegistry.addName(titaniumAxe, titaniumAxeName); + + + LanguageRegistry.instance().addStringLocalization("itemGroup.StarTreckBlocks", "StarTreck Blocks"); + LanguageRegistry.instance().addStringLocalization("itemGroup.StarTreckDrops", "StarTreck Drops"); + LanguageRegistry.instance().addStringLocalization("itemGroup.StarTreckIngots", "StarTreck Ingots"); + LanguageRegistry.instance().addStringLocalization("itemGroup.StarTreckTools", "StarTreck Tools"); + + } + + private void registerItems(){ + + GameRegistry.registerItem(titaniumPouder, "Titanium Pouder"); + GameRegistry.registerItem(titaniumIngot, "Titanium Ingot"); + GameRegistry.registerItem(cutter, "Cutter"); + GameRegistry.registerItem(titaniumStick, "Titanium Stick"); + GameRegistry.registerItem(titaniumShovel, "Titanium Shovel"); + GameRegistry.registerItem(titaniumPickaxe, "Titanium Pickaxe"); + GameRegistry.registerItem(titaniumAxe, "Titanium Axe"); + + } + + private void initCraftingRecipes(){ + + GameRegistry.addShapelessRecipe(new ItemStack(this.titaniumPouder), new ItemStack(this.titaniumOre), new ItemStack(this.cutter)); + + } + + private void InitSmeltingRecipes(){ + + GameRegistry.addSmelting(titaniumPouder.itemID, new ItemStack(this.titaniumIngot), 0.5F); + + + //------------------- + //| titaniumStick + //------------------- + GameRegistry.addRecipe(new ItemStack(this.titaniumStick), "#X#", + "#X#", + "#X#", + '#', this.titaniumIngot, 'X', Item.stick); + + //------------------- + //| titaniumPickaxe + //------------------- + + GameRegistry.addRecipe(new ItemStack(this.titaniumPickaxe), "###", + "UXU", + "UXU", + '#', this.titaniumIngot, 'X', this.titaniumPickaxe); + + //------------------- + //| titaniumAxe + //------------------- + + GameRegistry.addRecipe(new ItemStack(this.titaniumAxe), "##U", + "#XU", + "UXU", + '#', this.titaniumIngot, 'X', this.titaniumStick); + + //------------------- + //| titaniumAxe2 + //------------------- + + GameRegistry.addRecipe(new ItemStack(this.titaniumAxe), "U##", + "UX#", + "UXU", + '#', this.titaniumIngot, 'X', this.titaniumStick); + + //------------------- + //| titaniumShovel + //------------------- + + GameRegistry.addRecipe(new ItemStack(this.titaniumShovel), "U#U", + "UXU", + "UXU", + '#', this.titaniumIngot, 'X', this.titaniumStick); + + } + }