All the items

This commit is contained in:
Gig 2015-05-04 21:52:08 +01:00
parent 617a33aea3
commit f4a717c0ea
13 changed files with 803 additions and 1 deletions

View file

@ -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));
}

View file

@ -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));
}
}

View file

@ -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));
}
}

View file

@ -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));
}
}

View file

@ -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));
}
}

View file

@ -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();
}

View file

@ -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");

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}