Hello Forge Community!
For my new mod I am adding blocks runtime. This is necessary as there's user input to add the correct block to his game. The code for adding this block is:
String blockName = "testblock";
Block block = new Block(Material.rock).setHardness(1.0F).setUnlocalizedName(blockName).setCreativeTab(CreativeTabs.tabBlock);
MyMod.blocks.add(block);
GameRegistry.registerBlock(block, blockName);
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(ModCreator.MODID + ":" + blockName, "inventory"));
However, this doesn't get the texture working, even though the texture is included in the mod's resources folder. If I do exactly the same as above of preinitialisation the texture works perfectly, so there is a texture baking happening within forge somewhere there which I'd have to trigger manually... But how?
The second problem I'm facing (unrelated to the previous problem) is that I'd like to bind a texture that's not in the mod's jar (resources folder). A texture file that is simply in the .minecraft folder. I can't seem to find out to bypass the minecraft "domain" system and just pass in a texture png file myself.
Does anyone have any pointers on how to do this?