Jump to content

[1.7.10] Block textures not showing up.


Recommended Posts

Posted

I have a block that can have multiple textures based on metadata. When I summon it, (setBlock method in World) it has the missing texture even though I have textures for it:

LPnkKDS.png

Here is my block's code:

public class BlockLightCrystal extends Block {
    public IIcon[] icons;

    public BlockLightCrystal(Material material) {
        super(material);

        this.setBlockName("blockLightCrystal");
        this.setBlockTextureName("LightCrystal_0");
        this.setLightLevel(2F);
    }

    @Override
    public void registerBlockIcons(IIconRegister reg) {
        icons = new IIcon[7];

        for (int i = 0; i < this.icons.length; ++ i)
        {
            this.icons[i] = reg.registerIcon(this.getTextureName() + "_" + i);
        }
    }

    @Override
    public IIcon getIcon(int side, int meta) {
        return this.icons[meta];
    }
}

 

It should work, but it isn't working.

 

Edit: Oh also, when I summon the block, I have the metadata changed to make the crystal look like it's growing. Hence the 7 different textures.

Posted

Isn't this line

this.icons[i] = reg.registerIcon(this.getTextureName() + "_" + i);

registering strings like "LightCrystal_0_0", "LightCrystal_0_1", etc.?

 

It'll probably work if you change it to

this.icons[i] = reg.registerIcon("LightCrystal" + "_" + i);

Posted

I changed it, but it's still doing the same thing:

6pKO8uW.png

And btw, I had it like this before.

this.setBlockTextureName("LightCrystal");

Still didn't work.

Posted

I changed it, but it's still doing the same thing:

6pKO8uW.png

And btw, I had it like this before.

this.setBlockTextureName("LightCrystal");

Still didn't work.

 

Does it work when registering the textures with the modid?

this.icons[i] = reg.registerIcon([YourMod].modid + ":" + "LightCrystal" + "_" + i);

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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