Posted June 2, 201510 yr 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: 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.
June 2, 201510 yr 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);
June 2, 201510 yr I changed it, but it's still doing the same thing: And btw, I had it like this before. this.setBlockTextureName("LightCrystal"); Still didn't work.
June 2, 201510 yr I changed it, but it's still doing the same thing: 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.