Jump to content

implemented block missing texture


FRA32

Recommended Posts

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

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.