Jump to content

[1.10.2] [Solved] Need help with .json uvlock


Erfurt

Recommended Posts

Hey guys,

 

So I have made a custom directional block, and everything is actually working as intended. How ever I have some texturing issues... The thing is that I want to have some of the textures/model bits set to uvlock true, while others I want to have uvlock false. I have noticed that when I specify the uvlock in the blockstate, it sets everything to either true or false. I have tried to put "uvlock": false in every line that I want to be set to false and "uvlock": true at the ones I want to be true, inside the block model json. But that doesn't seem to work. I'm beginning to wondering if what I want to do is even possible. Maybe it's only possible to specify the uvlock in the blockstate json? If so, is there a way to specify something different for two separate sections/models?

 

This is the code I have tried for the block model json.

 

 

{
    "parent": "block/block",
    "display": {
        "gui": {
            "rotation": [ 30, 315, 0 ],
            "translation": [ 0, 0, 0],
            "scale":[ 0.625, 0.625, 0.625 ]
        },
        "fixed": {
            "rotation": [ 0, 90, 0 ],
            "translation": [ 0, 0, 0 ],
            "scale": [ 0.5, 0.5, 0.5 ]
        }
    },
    "textures": {
        "particle":"#all",
        "1": "blocks/iron_bars",
        "2": "blocks/iron_block",
        "3": "blocks/log_oak",
        "4": "blocks/log_oak_top"
    },
    "elements": [
        {
            "from": [  0.0,  0.0,  0.0 ], 
            "to":   [ 16.0, 14.0,  3.0 ], 
            "faces": {
                "north": { "texture": "#all", "uv": [  0.0,  2.0, 16.0, 16.0 ], "uvlock": true },
                "south": { "texture": "#all", "uv": [  0.0,  2.0, 16.0, 16.0 ], "uvlock": true },
                "down":  { "texture": "#all", "uv": [  0.0, 13.0, 16.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [  0.0, 14.0,  0.0 ], 
            "to":   [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#all", "uv": [  0.0,  0.0, 16.0,  2.0 ], "uvlock": true },
                "south": { "texture": "#all", "uv": [  0.0,  0.0, 16.0,  2.0 ], "uvlock": true },
                "up":    { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "down":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [  0.0,  0.0,  0.0 ], 
            "to":   [ 16.0,  1.0, 16.0 ], 
            "faces": {
                "south": { "texture": "#all", "uv": [  0.0, 15.0, 16.0, 16.0 ], "uvlock": true },
                "up":    { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "down":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [ -2.0,  0.0,  0.0 ], 
            "to":   [  0.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#all", "uv": [  0.0,  0.0,  2.0, 16.0 ], "uvlock": true },
                "east":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "south": { "texture": "#all", "uv": [ 14.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "west":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "up":    { "texture": "#all", "uv": [ 14.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "down":  { "texture": "#all", "uv": [ 14.0,  0.0, 16.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [ 16.0,  0.0,  0.0 ], 
            "to":   [ 18.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#all", "uv": [ 14.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "east":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "south": { "texture": "#all", "uv": [  0.0,  0.0,  2.0, 16.0 ], "uvlock": true },
                "west":  { "texture": "#all", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": true },
                "up":    { "texture": "#all", "uv": [  0.0,  0.0,  2.0, 16.0 ], "uvlock": true },
                "down":  { "texture": "#all", "uv": [  0.0,  0.0,  2.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [  5.0, 16.0,  5.0 ], 
            "to":   [ 11.0, 24.0, 11.0 ], 
            "faces": {
                "north": { "texture":   "#2", "uv": [  5.0,  8.0, 11.0, 16.0 ], "uvlock": true },
                "east":  { "texture":   "#2", "uv": [  5.0,  8.0, 11.0, 16.0 ], "uvlock": true },
                "south": { "texture":   "#2", "uv": [  5.0,  8.0, 11.0, 16.0 ], "uvlock": true },
                "west":  { "texture":   "#2", "uv": [  5.0,  8.0, 11.0, 16.0 ], "uvlock": true },
                "up":    { "texture":   "#2", "uv": [  5.0,  5.0, 11.0, 11.0 ], "uvlock": true }
            }
        },
        {
            "from": [  5.0, 18.0,  0.0 ], 
            "to":   [ 11.0, 24.0,  5.0 ], 
            "faces": {
                "north": { "texture":   "#2", "uv": [  5.0,  8.0, 11.0, 14.0 ], "uvlock": true },
                "east":  { "texture":   "#2", "uv": [ 11.0,  8.0, 16.0, 14.0 ], "uvlock": true },
                "west":  { "texture":   "#2", "uv": [  0.0,  8.0,  5.0, 14.0 ], "uvlock": true },
                "up":    { "texture":   "#2", "uv": [  5.0,  0.0, 11.0,  5.0 ], "uvlock": true },
                "down":  { "texture":   "#2", "uv": [  5.0, 11.0, 11.0, 16.0 ], "uvlock": true }
            }
        },
        {
            "from": [  2.0,  1.0, 14.0 ], 
            "to":   [  4.0,  9.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "east":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "west":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  7.0,  7.0,  9.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [  7.0,  1.0, 14.0 ], 
            "to":   [  9.0,  9.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "east":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "west":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  7.0,  7.0,  9.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [ 12.0,  1.0, 14.0 ], 
            "to":   [ 14.0,  9.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "east":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "west":  { "texture":   "#1", "uv": [  2.0,  4.0,  4.0, 12.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  7.0,  7.0,  9.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [  0.0,  4.0, 14.0 ], 
            "to":   [  2.0,  6.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "down":  { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [  4.0,  4.0, 14.0 ], 
            "to":   [  7.0,  6.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "down":  { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [ 14.0,  4.0, 14.0 ], 
            "to":   [ 16.0,  6.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false },
                "down":  { "texture":   "#1", "uv": [  0.0,  7.0,  2.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [  9.0,  4.0, 14.0 ], 
            "to":   [ 12.0,  6.0, 16.0 ], 
            "faces": {
                "north": { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "south": { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "up":    { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false },
                "down":  { "texture":   "#1", "uv": [  4.0,  7.0,  7.0,  9.0 ], "uvlock": false }
            }
        },
        {
            "from": [  3.0,  1.0,  7.0 ], 
            "to":   [ 13.0,  5.0, 11.0 ], 
            "faces": {
                "north": { "texture":   "#3", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": false, "rotation": 90 },
                "east":  { "texture":   "#4", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": false },
                "south": { "texture":   "#3", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": false, "rotation": 90 },
                "west":  { "texture":   "#4", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": false },
                "up":    { "texture":   "#3", "uv": [  0.0,  0.0, 16.0, 16.0 ], "uvlock": false, "rotation": 90 }
            }
        }
    ]
}

 

 

Link to comment
Share on other sites

I don't think you can. I think uvlock covers the whole model.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I don't think you can. I think uvlock covers the whole model.

 

I have come to the same conclusion. Do you know if it's possible to combine two models, for the different variants in the same blockstate json file?

 

This is my current blockstate json

 

 

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/stonebrick"
        },
        "model": "wm:fireplace",
        "uvlock" : true
    },
    "variants": {
        "facing=north,lit=true" : { "model": "wm:fireplace_lit", "uvlock" : false           },
        "facing=north,lit=false": { "model": "wm:fireplace_off", "uvlock" : false           },
        "facing=east,lit=true"  : { "model": "wm:fireplace_lit", "uvlock" : false, "y":  90 },
        "facing=east,lit=false" : { "model": "wm:fireplace_off", "uvlock" : false, "y":  90 },
        "facing=south,lit=true" : { "model": "wm:fireplace_lit", "uvlock" : false, "y": 180 },
        "facing=south,lit=false": { "model": "wm:fireplace_off", "uvlock" : false, "y": 180 },
        "facing=west,lit=true"  : { "model": "wm:fireplace_lit", "uvlock" : false, "y": 270 },
        "facing=west,lit=false" : { "model": "wm:fireplace_off", "uvlock" : false, "y": 270 }
    }
}

 

 

And this doesn't show the "model": "wm:fireplace". In an earlier version of this blockstate, before I chose to add a "lit" property to the block, it was showing both models perfectly fine. Not sure what have happened.

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

 

Thanks, but that didn't seem to do anything. Perhaps I'm doing something wrong. And as I mentioned in another post, everything was working at a previously state, so I'm pretty sure that there's nothing wrong with my models.

 

This is how the blockstate file looks like now.

 

 

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/stonebrick"
        },
        "model": "wm:fireplace",
        "uvlock" : true
    },
    "variants": {
        "lit" : {
            "true"  : { "model": "wm:fireplace_lit", "uvlock" : false },
            "false" : { "model": "wm:fireplace_off", "uvlock" : false }
            },
        "facing" : {
            "north" : {          },
            "east"  : { "y":  90 },
            "south" : { "y": 180 },
            "west"  : { "y": 270 }
            }
    }
} 

 

 

Link to comment
Share on other sites

Your json file is not using submodles.

 

Compare:

"true"  : { "model": "wm:fireplace_lit" },

With:

"1": { "submodel": "wall_n" }

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Your json file is not using submodles.

 

Compare:

"true"  : { "model": "wm:fireplace_lit" },

With:

"1": { "submodel": "wall_n" }

 

I see what I did wrong, the model I wanted to add, I should have added like this "true"  : { "submodel": "wm:fireplace_lit", "uvlock" : false } and not like I had before.

 

Thanks for the help :)

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.