From f4a717c0eac0a10e6c8b4077930db846fde53e9d Mon Sep 17 00:00:00 2001 From: Gig Date: Mon, 4 May 2015 21:52:08 +0100 Subject: [PATCH] All the items --- .../techreborn/blocks/BlockChunkLoader.java | 2 +- .../techreborn/blocks/BlockFusionCoil.java | 62 +++++++++++++ .../blocks/BlockFusionControlComputer.java | 62 +++++++++++++ .../techreborn/blocks/BlockLightningRod.java | 62 +++++++++++++ .../blocks/BlockPlasmaGenerator.java | 62 +++++++++++++ src/main/java/techreborn/init/ModBlocks.java | 20 ++++ src/main/java/techreborn/init/ModItems.java | 24 +++++ .../java/techreborn/items/ItemCrushedOre.java | 83 +++++++++++++++++ .../java/techreborn/items/ItemDustTiny.java | 93 +++++++++++++++++++ .../java/techreborn/items/ItemNuggets.java | 83 +++++++++++++++++ .../java/techreborn/items/ItemPlates.java | 85 +++++++++++++++++ .../items/ItemPurifiedCrushedOre.java | 83 +++++++++++++++++ src/main/java/techreborn/items/ItemRods.java | 83 +++++++++++++++++ 13 files changed, 803 insertions(+), 1 deletion(-) create mode 100644 src/main/java/techreborn/blocks/BlockFusionCoil.java create mode 100644 src/main/java/techreborn/blocks/BlockFusionControlComputer.java create mode 100644 src/main/java/techreborn/blocks/BlockLightningRod.java create mode 100644 src/main/java/techreborn/blocks/BlockPlasmaGenerator.java create mode 100644 src/main/java/techreborn/items/ItemCrushedOre.java create mode 100644 src/main/java/techreborn/items/ItemDustTiny.java create mode 100644 src/main/java/techreborn/items/ItemNuggets.java create mode 100644 src/main/java/techreborn/items/ItemPlates.java create mode 100644 src/main/java/techreborn/items/ItemPurifiedCrushedOre.java create mode 100644 src/main/java/techreborn/items/ItemRods.java diff --git a/src/main/java/techreborn/blocks/BlockChunkLoader.java b/src/main/java/techreborn/blocks/BlockChunkLoader.java index 79a7c6da6..f106c103e 100644 --- a/src/main/java/techreborn/blocks/BlockChunkLoader.java +++ b/src/main/java/techreborn/blocks/BlockChunkLoader.java @@ -61,7 +61,7 @@ public class BlockChunkLoader extends BlockMachineBase{ return metadata == 0 && side == 3 ? this.iconFront : side == 1 ? this.iconTop : - side == 6 ? this.iconBottom: (side == 0 ? this.iconTop + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop : (side == metadata ? this.iconFront : this.blockIcon)); } diff --git a/src/main/java/techreborn/blocks/BlockFusionCoil.java b/src/main/java/techreborn/blocks/BlockFusionCoil.java new file mode 100644 index 000000000..a85f9a2ca --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockFusionCoil.java @@ -0,0 +1,62 @@ +package techreborn.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import techreborn.Core; +import techreborn.client.GuiHandler; +import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileMachineCasing; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFusionCoil extends BlockMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @SideOnly(Side.CLIENT) + private IIcon iconBottom; + + public BlockFusionCoil(Material material) + { + super(material); + setBlockName("techreborn.fusioncoil"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("techreborn:machine/fusion_coil"); + this.iconFront = icon.registerIcon("techreborn:machine/fusion_coil"); + this.iconTop = icon.registerIcon("techreborn:machine/fusion_coil"); + this.iconBottom = icon.registerIcon("techreborn:machine/fusion_coil"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + + return metadata == 0 && side == 3 ? this.iconFront + : side == 1 ? this.iconTop : + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop + : (side == metadata ? this.iconFront : this.blockIcon)); + + } + +} diff --git a/src/main/java/techreborn/blocks/BlockFusionControlComputer.java b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java new file mode 100644 index 000000000..3a2d7662a --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java @@ -0,0 +1,62 @@ +package techreborn.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import techreborn.Core; +import techreborn.client.GuiHandler; +import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileMachineCasing; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFusionControlComputer extends BlockMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @SideOnly(Side.CLIENT) + private IIcon iconBottom; + + public BlockFusionControlComputer(Material material) + { + super(material); + setBlockName("techreborn.fusioncontrolcomputer"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + this.iconFront = icon.registerIcon("techreborn:machine/fusion_control_computer_front"); + this.iconTop = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + this.iconBottom = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + + return metadata == 0 && side == 3 ? this.iconFront + : side == 1 ? this.iconTop : + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop + : (side == metadata ? this.iconFront : this.blockIcon)); + + } + +} diff --git a/src/main/java/techreborn/blocks/BlockLightningRod.java b/src/main/java/techreborn/blocks/BlockLightningRod.java new file mode 100644 index 000000000..34452f957 --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockLightningRod.java @@ -0,0 +1,62 @@ +package techreborn.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import techreborn.Core; +import techreborn.client.GuiHandler; +import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileMachineCasing; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockLightningRod extends BlockMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @SideOnly(Side.CLIENT) + private IIcon iconBottom; + + public BlockLightningRod(Material material) + { + super(material); + setBlockName("techreborn.lightningrod"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("techreborn:machine/idsu_front"); + this.iconFront = icon.registerIcon("techreborn:machine/idsu_front"); + this.iconTop = icon.registerIcon("techreborn:machine/lightning_rod_top"); + this.iconBottom = icon.registerIcon("techreborn:machine/extreme_voltage_machine_side"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + + return metadata == 0 && side == 3 ? this.iconFront + : side == 1 ? this.iconTop : + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop + : (side == metadata ? this.iconFront : this.blockIcon)); + + } + +} diff --git a/src/main/java/techreborn/blocks/BlockPlasmaGenerator.java b/src/main/java/techreborn/blocks/BlockPlasmaGenerator.java new file mode 100644 index 000000000..bd4fb35b7 --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockPlasmaGenerator.java @@ -0,0 +1,62 @@ +package techreborn.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import techreborn.Core; +import techreborn.client.GuiHandler; +import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileMachineCasing; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPlasmaGenerator extends BlockMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @SideOnly(Side.CLIENT) + private IIcon iconBottom; + + public BlockPlasmaGenerator(Material material) + { + super(material); + setBlockName("techreborn.plasmagenerator"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + this.iconFront = icon.registerIcon("techreborn:machine/plasma_generator_front"); + this.iconTop = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + this.iconBottom = icon.registerIcon("techreborn:machine/plasma_generator_side_off"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) + { + + return metadata == 0 && side == 3 ? this.iconFront + : side == 1 ? this.iconTop : + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop + : (side == metadata ? this.iconFront : this.blockIcon)); + + } + +} diff --git a/src/main/java/techreborn/init/ModBlocks.java b/src/main/java/techreborn/init/ModBlocks.java index 60bcb12db..fb746b713 100644 --- a/src/main/java/techreborn/init/ModBlocks.java +++ b/src/main/java/techreborn/init/ModBlocks.java @@ -16,6 +16,8 @@ import techreborn.blocks.BlockDieselGenerator; import techreborn.blocks.BlockDistillationTower; import techreborn.blocks.BlockDragonEggSiphoner; import techreborn.blocks.BlockElectricCraftingTable; +import techreborn.blocks.BlockFusionCoil; +import techreborn.blocks.BlockFusionControlComputer; import techreborn.blocks.BlockGrinder; import techreborn.blocks.BlockHighlyAdvancedMachine; import techreborn.blocks.BlockIDSU; @@ -24,12 +26,14 @@ import techreborn.blocks.BlockIndustrialElectrolyzer; import techreborn.blocks.BlockLathe; import techreborn.blocks.BlockLesu; import techreborn.blocks.BlockLesuStorage; +import techreborn.blocks.BlockLightningRod; import techreborn.blocks.BlockMachineCasing; import techreborn.blocks.BlockMagicEnergyAbsorber; import techreborn.blocks.BlockMagicEnergyConverter; import techreborn.blocks.BlockMatterFabricator; import techreborn.blocks.BlockMetalShelf; import techreborn.blocks.BlockOre; +import techreborn.blocks.BlockPlasmaGenerator; import techreborn.blocks.BlockPlateCuttingMachine; import techreborn.blocks.BlockQuantumChest; import techreborn.blocks.BlockQuantumTank; @@ -97,6 +101,10 @@ public class ModBlocks { public static Block Distillationtower; public static Block ElectricCraftingTable; public static Block VacuumFreezer; + public static Block PlasmaGenerator; + public static Block FusionControlComputer; + public static Block FusionCoil; + public static Block LightningRod; public static Block ore; public static Block storage; @@ -237,6 +245,18 @@ public class ModBlocks { VacuumFreezer = new BlockVacuumFreezer(Material.rock); GameRegistry.registerBlock(VacuumFreezer, "vacuumfreezer"); + + PlasmaGenerator = new BlockPlasmaGenerator(Material.rock); + GameRegistry.registerBlock(PlasmaGenerator, "plasmagenerator"); + + FusionControlComputer = new BlockFusionControlComputer(Material.rock); + GameRegistry.registerBlock(FusionControlComputer, "fusioncontrolcomputer"); + + FusionCoil = new BlockFusionCoil(Material.rock); + GameRegistry.registerBlock(FusionCoil, "fusioncoil"); + + LightningRod = new BlockLightningRod(Material.rock); + GameRegistry.registerBlock(LightningRod, "lightningrod"); registerOreDict(); } diff --git a/src/main/java/techreborn/init/ModItems.java b/src/main/java/techreborn/init/ModItems.java index a82d0a137..22f97410b 100644 --- a/src/main/java/techreborn/init/ModItems.java +++ b/src/main/java/techreborn/init/ModItems.java @@ -6,11 +6,17 @@ import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import techreborn.items.ItemCells; +import techreborn.items.ItemCrushedOre; +import techreborn.items.ItemDustTiny; import techreborn.items.ItemDusts; import techreborn.items.ItemDustsSmall; import techreborn.items.ItemGems; import techreborn.items.ItemIngots; +import techreborn.items.ItemNuggets; import techreborn.items.ItemParts; +import techreborn.items.ItemPlates; +import techreborn.items.ItemPurifiedCrushedOre; +import techreborn.items.ItemRods; import techreborn.items.ItemUUmatter; import techreborn.items.armor.ItemGravityChest; import techreborn.items.armor.ItemLapotronPack; @@ -38,6 +44,12 @@ public class ModItems { public static Item advancedDrill; public static Item manuel; public static Item uuMatter; + public static Item dustTiny; + public static Item plate; + public static Item nuggets; + public static Item rods; + public static Item crushedOre; + public static Item purifiedCrushedOre; public static void init() { @@ -69,6 +81,18 @@ public class ModItems { GameRegistry.registerItem(manuel, "techmanuel"); uuMatter = new ItemUUmatter(); GameRegistry.registerItem(uuMatter, "uumatter"); + dustTiny = new ItemDustTiny(); + GameRegistry.registerItem(dustTiny, "dustTiny"); + plate = new ItemPlates(); + GameRegistry.registerItem(plate, "plates"); + nuggets = new ItemNuggets(); + GameRegistry.registerItem(nuggets, "nuggets"); + rods = new ItemRods(); + GameRegistry.registerItem(rods, "rods"); + crushedOre = new ItemCrushedOre(); + GameRegistry.registerItem(crushedOre, "crushedore"); + purifiedCrushedOre = new ItemPurifiedCrushedOre(); + GameRegistry.registerItem(purifiedCrushedOre, "purifiedCrushedOre"); LogHelper.info("TechReborns Items Loaded"); diff --git a/src/main/java/techreborn/items/ItemCrushedOre.java b/src/main/java/techreborn/items/ItemCrushedOre.java new file mode 100644 index 000000000..95501f465 --- /dev/null +++ b/src/main/java/techreborn/items/ItemCrushedOre.java @@ -0,0 +1,83 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemCrushedOre extends Item { + public static final String[] types = new String[] + { "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass", + "cadmium", "chrome", "cupronickel", "electrum", "indium", + "invar", "iridium", "kanthal", "lodestone", "magnalium", "nichrome", "nickel", + "osmium", "platinum", "steel", "tellurium", "titanium", + "tungsten", "hotTungstensteel", "tungstensteel", "zinc" }; + + private IIcon[] textures; + + public ItemCrushedOre() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.crushedore"); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "crushedOre/" + + types[i] + "Ore"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +} diff --git a/src/main/java/techreborn/items/ItemDustTiny.java b/src/main/java/techreborn/items/ItemDustTiny.java new file mode 100644 index 000000000..c22f91b8d --- /dev/null +++ b/src/main/java/techreborn/items/ItemDustTiny.java @@ -0,0 +1,93 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemDustTiny extends ItemTR { + public static final String[] types = new String[] + { "almandine", "aluminumBrass", "aluminium", "alumite", "andradite", + "antimony", "ardite", "ashes", "basalt", "bauxite", "biotite", + "brass", "bronze", "cadmium", "calcite", "charcoal", "chrome", + "cinnabar", "clay", "coal", "cobalt", "copper", "cupronickel", + "darkAshes", "darkIron", "diamond", "electrum", "emerald", + "enderEye", "enderPearl", "endstone", "flint", "gold", "graphite", + "grossular", "indium", "invar", "iridium", "iron", "kanthal", "lapis", "lazurite", + "lead", "limestone", "lodestone", "magnesium", "magnetite", "manganese", + "manyullyn", "marble", "mithril", "netherrack", "nichrome", "nickel", + "obsidian", "osmium", "peridot", "phosphorous", "platinum", "potassiumFeldspar", + "pyrite", "pyrope", "redGarnet", "redrock", "ruby", "saltpeter", + "sapphire", "silicon", "sodalite", "spessartine", "sphalerite", + "steel", "sulfur", "tellurium", "teslatite", "tetrahedrite", "tin", + "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", + "zinc" }; + + private IIcon[] textures; + + public ItemDustTiny() + { + setUnlocalizedName("techreborn.dusttiny"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "tinyDust/" + + types[i] + "Dust"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +} diff --git a/src/main/java/techreborn/items/ItemNuggets.java b/src/main/java/techreborn/items/ItemNuggets.java new file mode 100644 index 000000000..5506f4441 --- /dev/null +++ b/src/main/java/techreborn/items/ItemNuggets.java @@ -0,0 +1,83 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemNuggets extends Item { + public static final String[] types = new String[] + { "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass", + "cadmium", "chrome", "cupronickel", "electrum", "indium", + "invar", "iridium", "kanthal", "lodestone", "magnalium", "nichrome", "nickel", + "osmium", "platinum", "steel", "tellurium", "titanium", + "tungsten", "hotTungstensteel", "tungstensteel", "zinc" }; + + private IIcon[] textures; + + public ItemNuggets() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.nuggets"); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "nuggets/" + + types[i] + "Nugget"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +} diff --git a/src/main/java/techreborn/items/ItemPlates.java b/src/main/java/techreborn/items/ItemPlates.java new file mode 100644 index 000000000..54905421d --- /dev/null +++ b/src/main/java/techreborn/items/ItemPlates.java @@ -0,0 +1,85 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemPlates extends ItemTR { + public static final String[] types = new String[] + { "Berylium", "biomass", "calciumCarbonate", "calcium", "carbon", + "chlorine", "deuterium", "diesel", "ethanol", "glyceryl", + "helium3", "helium", "heliumPlasma", "hydrogen", "ice", "lithium", + "mercury", "methane", "nitrocarbon", "nitroCoalfuel", + "nitroDiesel", "nitrogen", "nitrogenDioxide", "oil", "potassium", + "seedOil", "silicon", "sodium", "sodiumPersulfate", + "sodiumSulfide", "sulfur", "sulfuricAcid", "tritium", "wolframium", }; + + private IIcon[] textures; + + public ItemPlates() + { + setUnlocalizedName("techreborn.plate"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "plate/" + + types[i] + "Plate"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +} diff --git a/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java new file mode 100644 index 000000000..217e0cd5b --- /dev/null +++ b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java @@ -0,0 +1,83 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemPurifiedCrushedOre extends Item { + public static final String[] types = new String[] + { "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass", + "cadmium", "chrome", "cupronickel", "electrum", "indium", + "invar", "iridium", "kanthal", "lodestone", "magnalium", "nichrome", "nickel", + "osmium", "platinum", "steel", "tellurium", "titanium", + "tungsten", "hotTungstensteel", "tungstensteel", "zinc" }; + + private IIcon[] textures; + + public ItemPurifiedCrushedOre() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.purifiedcrushedore"); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "purifiedCrushedOre/" + + types[i] + "Ore"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +} diff --git a/src/main/java/techreborn/items/ItemRods.java b/src/main/java/techreborn/items/ItemRods.java new file mode 100644 index 000000000..903a71b91 --- /dev/null +++ b/src/main/java/techreborn/items/ItemRods.java @@ -0,0 +1,83 @@ +package techreborn.items; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import techreborn.client.TechRebornCreativeTabMisc; + +public class ItemRods extends Item { + public static final String[] types = new String[] + { "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass", + "cadmium", "chrome", "cupronickel", "electrum", "indium", + "invar", "iridium", "kanthal", "lodestone", "magnalium", "nichrome", "nickel", + "osmium", "platinum", "steel", "tellurium", "titanium", + "tungsten", "hotTungstensteel", "tungstensteel", "zinc" }; + + private IIcon[] textures; + + public ItemRods() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.rod"); + } + + @Override + // Registers Textures For All Dusts + public void registerIcons(IIconRegister iconRegister) + { + textures = new IIcon[types.length]; + + for (int i = 0; i < types.length; ++i) + { + textures[i] = iconRegister.registerIcon("techreborn:" + "metalRod" + + types[i] + "Rod"); + } + } + + @Override + // Adds Texture what match's meta data + public IIcon getIconFromDamage(int meta) + { + if (meta < 0 || meta >= textures.length) + { + meta = 0; + } + + return textures[meta]; + } + + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + + return super.getUnlocalizedName() + "." + types[meta]; + } + + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + + @Override + public EnumRarity getRarity(ItemStack itemstack) + { + return EnumRarity.uncommon; + } + +}