Jump to content

[1.10] Rendering model variant Gui transformation


juanitodelavega

Recommended Posts

I have a block with this block state

 

{
    "forge_marker": 1,
    "defaults": {
        "transform":{
            "gui":{
                "rotation": {
                    "x":120
                },
                "translation": [ 0, 0.2, 0],
                "scale": 1.2
            }
        },
        "textures":{ 
            "#inductor-base": "sfartifacts:blocks/inductor-base",
            "#inductor-staff": "sfartifacts:blocks/inductor-staff"
        },
        "model": "sfartifacts:inductor-base.obj"
    },
    "variants": {
        "normal": [{
            "submodel": {
                "staff": {
                    "model": "sfartifacts:inductor-staff.obj" 
                }
            }
        }],
        "inventory": [{
            "submodel": {
                "staff": {
                    "model": "sfartifacts:inductor-staff.obj" 
                }
            }
        }],
        "type_tech": {
            "basic":  {
                "submodel": {
                    "staff": {
                        "model": "sfartifacts:inductor-staff.obj" 
                    }
                },
                "textures": {
                    "#inductor-staff": "sfartifacts:blocks/inductor-staff"
                }
            },
            "advanced":  {
                "submodel": {
                    "staff": {
                        "model": "sfartifacts:inductor-staff.obj" 
                    }
                },
                "textures": {
                    "#inductor-staff": "sfartifacts:blocks/inductor-staff1"
                }
            },
            "basicenergized":  {
                "submodel": {
                    "staff": {
                        "model": "sfartifacts:inductor-staff.obj" 
                    }
                },
                "textures": {
                    "#inductor-staff": "sfartifacts:blocks/inductor-staff2"
                }
            },
            "advancedenergized":  {
                "submodel": {
                    "staff": {
                        "model": "sfartifacts:inductor-staff.obj" 
                    }
                },
                "textures": {
                    "#inductor-staff": "sfartifacts:blocks/inductor-staff3"
                }
            }
        },
        "all_facing": {
            "down":  {"x":90},
            "up":    {"x":270},
            "north": {},
            "south": {"y":180},
            "west":  {"y":270},
            "east":  {"y":90}
        }
    }
}

 

The issue is the gui in inventory rendering.

I try two method to register the 4 differents variants (basic , advanced, basicenergyzed, advancedenergyzed).

 

First one :

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 0, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 1, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 2, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 3, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "inventory"));

This method register 4 item with the gui transformation right but they are all with the same textures

 

Second one

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 0, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=basic"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 1, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=advanced"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 2, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=basicenergyzed"));
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(..itemFB.., 3, new ModelResourceLocation(Ressources.MODID+":ul_block_name", "all_facing=up,type_tech=advancedenergyzed"));

This method register 4 item with the right textures but the gui transformation are not take into acocunt.

 

Am i doing something wrong or is there a way that i dont know to have all you desired variant with the textures you want and the right gui transformation ?

 

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.