Jump to content

Textures aren't loading, but no errors are thrown.


linkseyi

Recommended Posts

I am running into a frustrating problem with block textures.  I can use the setBlockTextureName method or the IconRegister method, but the block in-game gets the purple/black placeholder.  The part that has me confused is that there is nothing in the console about "missing textures", which leads me to believe there's something sketchy in my code.  Keep in mind that the mod is loading and being recognized by Forge without any problems.

 

Here are the essentials:

 

@Mod(modid = "example", version = "1")
public class ExampleMod
{
   // public static final String MODID = "examplemod";
    public static final String VERSION = "1.0";
    
    @Instance(value = "example")
    public static ExampleMod instance;
    
    public static Block example;
    
    @SidedProxy(clientSide="com.example.examplemod.ClientProxy", serverSide="com.example.examplemod.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	example = new BlockExample().setBlockTextureName("example:Block1").setBlockName("example").setHardness(5F).setResistance(5F).setLightLevel(1F).setCreativeTab(CreativeTabs.tabBlock);
    	GameRegistry.registerBlock(example, "example");
    }
}

 

And BlockExample

public class BlockExample extends Block {

protected BlockExample() {
	super(Material.rock);
}

IIcon blockIcon;

@SideOnly(Side.CLIENT)
    public IIcon getIcon(int p_149691_1_, int p_149691_2_)
    {
	return blockIcon;
    }

@SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister r)
    {
        this.blockIcon = r.registerIcon("example:Block1");
    }

}

Link to comment
Share on other sites

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.