Added cells

This commit is contained in:
Gig 2015-04-16 23:42:05 +01:00
parent 7cbd27150e
commit 3c87b1ad1d
6 changed files with 113 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.items.ItemCells;
import techreborn.items.ItemDusts;
import techreborn.items.ItemDustsSmall;
import techreborn.items.ItemGems;
@ -26,6 +27,7 @@ public class ModItems {
public static Item ingots;
public static Item gems;
public static Item parts;
public static Item cells;
public static Item rockCutter;
public static Item lithiumBatpack;
public static Item lapotronpack;
@ -44,6 +46,8 @@ public class ModItems {
GameRegistry.registerItem(gems, "gem");
parts = new ItemParts();
GameRegistry.registerItem(parts, "part");
cells = new ItemCells();
GameRegistry.registerItem(cells, "cell");
rockCutter = new ItemRockCutter(ToolMaterial.EMERALD);
GameRegistry.registerItem(rockCutter, "rockCutter");
lithiumBatpack = new ItemLithiumBatpack(ArmorMaterial.DIAMOND, 7, 1);

View file

@ -0,0 +1,75 @@
package techreborn.items;
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.TechRebornCreativeTab;
import java.util.List;
public class ItemCells extends ItemTR {
public static final String[] types = new String[]
{
"Berylium", "biomass", "calciumCarbonate", "calcium", "carbon", "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",
"sulfuricAcid", "wolframium",
};
private IIcon[] textures;
public ItemCells() {
setUnlocalizedName("techreborn.cell");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.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:" + "cells/" + types[i] + "Cell");
}
}
@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

@ -169,6 +169,40 @@ item.techreborn.dustsmall.Manyullyn.name=Small Pile of Manyullyn Dust
item.techreborn.dustsmall.AlBrass.name=Small Pile of AluminiumBrass Dust
item.techreborn.dustsmall.Alumite.name=Small Pile of Alumite Dust
#Cells
item.techreborn.cell.Berylium.name=Berylium Cell
item.techreborn.cell.biomass.name=Biomass Cell
item.techreborn.cell.calciumCarbonate.name=Calcium Carbonate Cell
item.techreborn.cell.calcium.name=Calcium Cell
item.techreborn.cell.carbon.name=Carbon Cell
item.techreborn.cell.chlorine.name=Chlorine Cell
item.techreborn.cell.deuterium.name=Deuterium Cell
item.techreborn.cell.diesel.name=Diesel Cell
item.techreborn.cell.ethanol.name=Ethanol Cell
item.techreborn.cell.glyceryl.name=Glyceryl Cell
item.techreborn.cell.helium3.name=Helium3 Cell
item.techreborn.cell.helium.name=Helium Cell
item.techreborn.cell.heliumPlasma.name=Helium Plasma Cell
item.techreborn.cell.hydrogen.name=Hydrogen Cell
item.techreborn.cell.ice.name=Ice Cell
item.techreborn.cell.lithium.name=Lithium Cell
item.techreborn.cell.mercury.name=Mercury Cell
item.techreborn.cell.methane.name=Methane Cell
item.techreborn.cell.nitrocarbon.name=Nitrocarbon Cell
item.techreborn.cell.nitroCoalfuel.name=Nitro Coal fuel Cell
item.techreborn.cell.nitroDiesel.name=Nitro Diesel Cell
item.techreborn.cell.nitrogen.name=Nitrogen Cell
item.techreborn.cell.nitrogenDioxide.name=Nitrogen Dioxide Cell
item.techreborn.cell.oil.name=Oil Cell
item.techreborn.cell.potassium.name=Potassium Cell
item.techreborn.cell.seedOil.name=SeedOil Cell
item.techreborn.cell.silicon.name=Silicon Cell
item.techreborn.cell.sodium.name=Sodium Cell
item.techreborn.cell.sodiumPersulfate.name=Sodium Persulfate Cell
item.techreborn.cell.sodiumSulfide.name=Sodium Sulfide Cell
item.techreborn.cell.sulfur.name=Sulfur Cell
item.techreborn.cell.sulfuricAcid.name=Sulfuric Acid Cell
item.techreborn.cell.wolframium.name=Wolframium Cell
#Gems
item.techreborn.gem.Ruby.name=Ruby