Added small dusts
This commit is contained in:
parent
39a8ffe739
commit
7cbd27150e
7 changed files with 147 additions and 2 deletions
|
@ -7,6 +7,7 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemDustsSmall;
|
||||
import techreborn.items.ItemGems;
|
||||
import techreborn.items.ItemIngots;
|
||||
import techreborn.items.ItemParts;
|
||||
|
@ -21,6 +22,7 @@ import techreborn.util.LogHelper;
|
|||
public class ModItems {
|
||||
|
||||
public static Item dusts;
|
||||
public static Item smallDusts;
|
||||
public static Item ingots;
|
||||
public static Item gems;
|
||||
public static Item parts;
|
||||
|
@ -34,6 +36,8 @@ public class ModItems {
|
|||
public static void init() {
|
||||
dusts = new ItemDusts();
|
||||
GameRegistry.registerItem(dusts, "dust");
|
||||
smallDusts = new ItemDustsSmall();
|
||||
GameRegistry.registerItem(smallDusts, "smallDust");
|
||||
ingots = new ItemIngots();
|
||||
GameRegistry.registerItem(ingots, "ingot");
|
||||
gems = new ItemGems();
|
||||
|
@ -51,7 +55,7 @@ public class ModItems {
|
|||
advancedDrill = new ItemAdvancedDrill();
|
||||
GameRegistry.registerItem(advancedDrill, "advancedDrill");
|
||||
gravityChest = new ItemGravityChest(ArmorMaterial.DIAMOND, 7, 1);
|
||||
GameRegistry.registerItem(gravityChest, "gravityChest");
|
||||
GameRegistry.registerItem(gravityChest, "gravitychestplate");
|
||||
|
||||
LogHelper.info("TechReborns Items Loaded");
|
||||
|
||||
|
@ -141,7 +145,6 @@ public class ModItems {
|
|||
OreDictionary.registerOre("ingotManyullyn", new ItemStack(ingots, 1, 19));
|
||||
OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(ingots, 1, 20));
|
||||
OreDictionary.registerOre("ingotAlumite", new ItemStack(ingots, 1, 21));
|
||||
|
||||
//Gems
|
||||
OreDictionary.registerOre("gemRuby", new ItemStack(gems, 1, 0));
|
||||
OreDictionary.registerOre("gemSapphire", new ItemStack(gems, 1, 1));
|
||||
|
|
77
src/main/java/techreborn/items/ItemDustsSmall.java
Normal file
77
src/main/java/techreborn/items/ItemDustsSmall.java
Normal file
|
@ -0,0 +1,77 @@
|
|||
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 ItemDustsSmall extends ItemTR {
|
||||
public static final String[] types = new String[]
|
||||
{
|
||||
"Almandine", "Aluminium", "Andradite", "Basalt", "Bauxite", "Brass", "Bronze",
|
||||
"Calcite", "Charcoal", "Chrome", "Cinnabar", "Clay", "Coal", "Copper", "Diamond",
|
||||
"Electrum", "Emerald", "EnderEye", "EnderPearl", "Endstone", "Gold", "GreenSapphire", "Grossular",
|
||||
"Invar", "Iron", "Lazurite", "Lead", "Magnesium", "Marble", "Netherrack", "Nickel", "Obsidian",
|
||||
"Olivine", "Platinum", "Pyrite", "Pyrope", "RedGarnet", "Ruby", "Saltpeter", "Sapphire",
|
||||
"Silver", "Sodalite", "Steel", "Sulfur", "Tin", "Titanium", "Tungsten",
|
||||
"Zinc",
|
||||
};
|
||||
|
||||
private IIcon[] textures;
|
||||
|
||||
public ItemDustsSmall() {
|
||||
setUnlocalizedName("techreborn.dustsmall");
|
||||
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:" + "smallDust/small" + 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.epic;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue