I just hopped into modding and was creating a few blocks for a little testing mod, but one of the blocks isn't displaying its texture when placed in the world, even tho I basically copied the model files of another block and changed the names. When in item form the texture is shown correctly. Can someone explain me where the source of the problem is? The code samples are below:
Block model File
{
"parent": "block/cube_all",
"textures": {
"all": "crystal:blocks/crystalDustBlock"
}
}
Item model file
{
"parent":"crystal:block/crystalDustBlock",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
Block Registration
public final class ModBlocks {
public static Block crystalOre;
public static Block crystalDustBlock;
public static Block crystalizer;
public static final void createBlocks() {
GameRegistry.registerBlock(crystalOre = new CrystalOre(),"crystalOre");
GameRegistry.registerBlock(crystalDustBlock = new CrystalDustBlock(), "crystalDustBlock");
GameRegistry.registerBlock(crystalizer = new Crystalizer(false), "crystalizer");
}
}
BlockRenderRegister:
public final class BlockRenderRegister {
public static String modid = Main.MODID;
public static void registerBlockRenderer() {
reg(ModBlocks.crystalOre);
reg(ModBlocks.crystalDustBlock);
reg(ModBlocks.crystalizer);
}
public static void reg(Block block) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(modid + ":" + block.getUnlocalizedName().substring(5), "inventory"));
}
}
The location of the texture is C:\Users\%My Username%\Desktop\Mod\src\main\resources\assets\crystal\textures\blocks\crystalDustBlock.png