Jump to content

[Solved] [1.12.2] Error rendering block model with variants


Recommended Posts

Posted (edited)

Aight. I've got this block, BlockElementalLight. It's pretty simple, it lights up.

Now, I've decided the block should be chiselable, meaning I need to create variants of the block to house the different textures.

The fruits of my labors are as shown:

2019-06-29_03_41_09.thumb.png.2a7428cf2650ab8d108d4f7276c19384.png

item textures working, but not the block ones.

I based my code, and my json files, off of the vanilla code for dirt (dirt, coarse, podzol). I'd like to know what I can do to fix this. Relevant code is below.

BlockElementalLight.java

ItemBlockElementalLight.java

CommonProxy.java (I guess CommonProxies are a bad thing to have... oh well)

Blocks class

Edit: Error Logs

My json files follow the vanilla format so there is a separate blockstate, item model, and block model for each variant.

(they are each the same, except have the _glassless or _intricate suffix for those specific ones)

Here are the samples:

blockstates/light_elemental.json

{
    "variants": {
        "normal": { "model": "adjunct:light_elemental" }
    }
}

models/block/light_elemental.json

{
    "parent": "block/cube_all",
    "textures": {
        "all": "adjunct:blocks/light_elemental"
    }
}

models/item/light_elemental.json

{"parent": "adjunct:block/light_elemental"}

 

Also, to make this post EVEN longer, you know how I said I wanted these to be chiselable. Well, the whole chisel thing isn't working properly.

I have this (addVariations) function being ran from my init event.

	public static void addVariations(){
		addVariation("light_elemental", BlocksAdjunct.lightElemental, 0);
		addVariation("light_elemental", BlocksAdjunct.lightElemental, 1);
		addVariation("light_elemental", BlocksAdjunct.lightElemental, 2);
	}
	
	public static void addVariation(String group, Block block, int meta){
		NBTTagCompound tag = new NBTTagCompound();
		tag.setString("group", group);
		tag.setString("block", block.getRegistryName().toString());
		tag.setInteger("meta", meta);
		FMLInterModComms.sendMessage("chisel", "add_variation", tag);
	}

It seems to register the 0 metadata block as one that can enter the chisel, but it doesn't do the same for the 1 and 2 metadata blocks. When I replace the 1 and 2 metadata blocks with vanilla ones, the chiseling works flawlessly. Any help is appreciated.

 

Thanks.

Edited by onVoid
Solving
Posted

Logs?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
On 6/29/2019 at 9:05 PM, onVoid said:

blockstates/light_elemental.json


{
    "variants": {
        "normal": { "model": "adjunct:light_elemental" }
    }
}

 

You define the "glassless", "default" and "intricate" in your code, but only have "normal" in your block state.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
3 hours ago, Cadiboo said:

You define the "glassless", "default" and "intricate" in your code, but only have "normal" in your block state.

Yeah, I did that because I was attempting to mirror vanilla, which has a different json for each block (which would be the default, glassless, and intricate ones) of dirt. Is that not doable for my situation?

Posted

you need to define all your variants in your block state. The variants can point to whatever models you want

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted (edited)
6 hours ago, Cadiboo said:

you need to define all your variants in your block state. The variants can point to whatever models you want

I have edited my light_elemental.json (in blockstates) to this:

{
    "variants": {
        "default": { "model": "adjunct:light_elemental" },
        "glassless": { "model": "adjunct:light_elemental_glassless" },
        "intricate": { "model": "adjunct:light_elemental_intricate" }
    }
}

yet the issue persists.

Edited by onVoid
Posted
1 hour ago, diesieben07 said:

Those are not your variants. Your block has a single property called variant with values default, glassless and intricate. Therefor your variants are variant=default, variant=glassless and variant=intricate. The log should indicate this to you, please read it.

 

Moreover, block metadata is gone in 1.13.x. I recommend to flatten your blocks already (i.e. use different blocks instead of one block with variant) to ease future updating.

You're right. I've changed it now. Solved.

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.