Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package science.Sapphire;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.client.renderer.texture.IconRegister;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.Entity;
- import net.minecraft.item.EnumArmorMaterial;
- import net.minecraft.item.ItemArmor;
- import net.minecraft.item.ItemStack;
- import net.minecraft.potion.Potion;
- import net.minecraft.potion.PotionEffect;
- public class SapphireArmor extends ItemArmor{
- private String texturePath = "random_mod:";
- private String iconPath = "random_mod:";
- public SapphireArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,
- int par3, int par4, String type) {
- super(par1, par2EnumArmorMaterial, par3, par4);
- this.setMaxStackSize(1);
- this.setCreativeTab(CreativeTabs.tabCombat);
- this.SetArmorType(type.toLowerCase(), par4);
- }
- // 0 = Helmet
- // 1 = Chest
- // 2 = Leggings
- // 3 = Boots
- private void SetArmorType(String type, int par4)
- {
- switch(par4)
- {
- case 0:
- this.setUnlocalizedName(type + "helmet");
- this.texturePath += type + "_layer_1.png";
- this.iconPath +=type + "_helmet";
- break;
- case 1:
- this.setUnlocalizedName(type + "chest");
- this.texturePath += type + "_layer_1.png";
- this.iconPath +=type + "_chest";
- break;
- case 2:
- this.setUnlocalizedName(type + "leggings");
- this.texturePath += type + "_layer_2.png";
- this.iconPath +=type + "_leggings";
- break;
- case 3:
- this.setUnlocalizedName(type + "boots");
- this.texturePath += type + "_layer_2.png";
- this.iconPath +=type + "_boots";
- break;
- }
- }
- @SideOnly(Side.CLIENT)
- public void registerIcons(IconRegister reg)
- {
- this.itemIcon = reg.registerIcon(this.iconPath);
- }
- @SideOnly(Side.CLIENT)
- public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
- {
- return this.texturePath;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment