Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

 

I have coded a new Armor (steel) And it won't load its textures when i put it on.

It loads a totally different armor. Also, when i delete my picture of what it needs to be, it always loads de replaced armor.

 

Hope you can help me, and you can always ask me!

Thanks! ;-)

 

Code of my main mod class:

http://pastebin.com/KrQdCKFc

 

Code of my Armor:

http://pastebin.com/HVBacwS7

 

Here are the pictures of what i got and what it needs to be:

 

What it needs to be:

http://minetronic.be/Needs_To_Be or http://minetronic.be/Needs_To_Be_2

What it is now:

http://minetronic.be/Problem or http://minetronic.be/Problem_2

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

I had this problem, mine was

"public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)" needed to be replaced with

"public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)"

 

I got it to work, but obviously you have yours already set to what I needed to set mine to. Try replacing armorHeatTreatedIronHelm = new HeatTreatedArmor(HeatTreatedIronArmorMaterial, armorHeatTreatedIronHelmID, 0).setUnlocalizedName("HeatTreatedIronHelm"); with

 

armorHeatTreatedIronHelm = new HeatTreatedArmor(0, HeatTreatedIronArmorMaterial, 0, 0, "HeatTreatedIronHelm").setUnlocalizedName("HeatTreatedIronHelm");

 

 

If it still doesnt work maybe try out some answers from my post http://www.minecraftforge.net/forum/index.php?topic=23412.0

  • Author

Okey, wil try to fix it

Thanks

 

Also can you maybe give me your code of your main mod class and your armor class?

That would be appreciated

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Okey, wil try to fix it

Thanks

 

Also can you maybe give me your code of your main mod class and your armor class?

That would be appreciated

 

 

Here is my armor class

package mymod.armor;

 

import net.minecraft.client.renderer.texture.IIconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.Entity;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class orcanArmor extends ItemArmor{

 

    private String texturePath = "mymod:textures/armor/";

    private String iconPath = "mymod:";

 

    public orcanArmor(int par1, ArmorMaterial par2EnumArmorMaterial, int par3, int par4, String myArmorName) {

        super(par2EnumArmorMaterial, par3, par4);

        this.setMaxStackSize(1);

        this.setCreativeTab(CreativeTabs.tabCombat);

        this.SetArmorType(myArmorName, par4);

    }

 

 

    private void SetArmorType(String myArmorName, int par4)

    {

        switch(par4)

        {

        case 0:

            this.setUnlocalizedName("orcanHelmet");

            this.texturePath += myArmorName + "_1.png";

            this.iconPath += "orcanHelmet";

            break;

        case 1:

            this.setUnlocalizedName("orcanChestplate");

            this.texturePath += myArmorName + "_1.png";

            this.iconPath += "orcanChestplate";

            break;

        case 2:

            this.setUnlocalizedName("orcanLeggings");

            this.texturePath += myArmorName + "_2.png";

            this.iconPath += "orcanLeggings";

            break;

        case 3:

            this.setUnlocalizedName("orcanBoots");

            this.texturePath += myArmorName + "_1.png";

            this.iconPath += "orcanBoots";

            break;

        }

    }

 

    @SideOnly(Side.CLIENT)

    public void registerIcons(IIconRegister reg)

    {

        this.itemIcon = reg.registerIcon(this.iconPath);

    }

 

    public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)

    {

        return this.texturePath;

    }

 

}

 

Here is what I have in the register section of my main class

 

//Orcan Armor

        public static Item orcanHelmet;

        public static Item orcanChestplate;

        public static Item orcanLeggings;

        public static Item orcanBoots;

 

 

Here is what I have in the load section of my main class

 

  orcanHelmet = new orcanArmor(0, orcanArmorMaterial, 0, 0, "orcanArmor").setCreativeTab(MyCreativeTab_1);

  GameRegistry.registerItem(orcanHelmet, "orcanHelmet");

  LanguageRegistry.addName(orcanHelmet, "Orcan Helmet");

 

  orcanChestplate = new orcanArmor(0, orcanArmorMaterial, 0, 1, "orcanArmor").setCreativeTab(MyCreativeTab_1);

  GameRegistry.registerItem(orcanChestplate, "orcanChestplate");

  LanguageRegistry.addName(orcanChestplate, "Orcan Chestplate");

 

  orcanLeggings = new orcanArmor(0, orcanArmorMaterial, 0, 2, "orcanArmor").setCreativeTab(MyCreativeTab_1);

  GameRegistry.registerItem(orcanLeggings, "orcanLeggings");

  LanguageRegistry.addName(orcanLeggings, "Orcan Leggings");

 

  orcanBoots = new orcanArmor(0, orcanArmorMaterial, 0, 3, "orcanArmor").setCreativeTab(MyCreativeTab_1);

  GameRegistry.registerItem(orcanBoots, "orcanBoots");

  LanguageRegistry.addName(orcanBoots, "Orcan Boots");

 

  • Author

Jeah,

I tried, and it worked!

 

Thank you!

 

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.