Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Blockstate with item transforms doesn't load
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
MCrafterzz

[1.12.2] Blockstate with item transforms doesn't load

By MCrafterzz, March 25, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 25, 2018 (edited)

Here is the blockstate file:

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/dirt"
        }
    },
    "variants": {
        "layers": {
            "1": {
                "model": "ml:layer_2"
            },
            "2": {
                "model": "ml:layer_4"
            },
            "3": {
                "model": "ml:layer_6"
            },
            "4": {
                "model": "ml:layer_8"
            },
            "5": {
                "model": "ml:layer_10"
            },
            "6": {
                "model": "ml:layer_12"
            },
            "7": {
                "model": "ml:layer_14"
            },
            "8": {
                "model": "ml:layer_16"
            }
        },
        "inventory": [{
            "model": "ml:layer_2",
            "textures": {
                "all": "blocks/dirt"
            },
            "transform": {
                "display": {
                    "gui": {
                        "rotation": [30, 225, 0],
                        "translation": [0, 0, 0],
                        "scale": [0.625, 0.625, 0.625]
                    },
                    "ground": {
                        "rotation": [0, 0, 0],
                        "translation": [0, 3, 0],
                        "scale": [0.25, 0.25, 0.25]
                    },
                    "firstperson_righthand": {
                        "rotation": [0, 45, 0],
                        "translation": [0, 4.2, 0],
                        "scale": [0.40, 0.40, 0.40]
                    },
                    "firstperson_lefthand": {
                        "rotation": [0, 225, 0],
                        "translation": [0, 4.2, 0],
                        "scale": [0.40, 0.40, 0.40]
                    }
                }
            }
        }]
    }
}

Why doesn't this load correctly? It gives the error: [12:53:03] [main/ERROR] [FML]: Exception loading model for variant ml:dirt_layer#inventory for item "ml:dirt_layer", normal location exception

 

Removing the inventory part makes it load again.

 

Thankful for all help!

 

Edited March 25, 2018 by MCrafterzz
  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

Draco18s    2402

Draco18s

Draco18s    2402

  • Reality Controller
  • Draco18s
  • Members
  • 2402
  • 15923 posts
Posted March 25, 2018

The "transform" tag applies to models.

Blockstate files are not models.

  • Quote

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.

Share this post


Link to post
Share on other sites

Choonster    1651

Choonster

Choonster    1651

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1651
  • 5097 posts
Posted March 25, 2018

You can specify display transformations in Forge's blockstates format, but not in the Vanilla model format like you're doing.

 

I explain how to do this here.

  • Quote

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 26, 2018

Thanks Choonster, I did change it but it seems to ignore everything except the gui part:

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/dirt"
        }
    },
    "variants": {
        "layers": {
            "1": {
                "model": "ml:layer_2"
            },
            "2": {
                "model": "ml:layer_4"
            },
            "3": {
                "model": "ml:layer_6"
            },
            "4": {
                "model": "ml:layer_8"
            },
            "5": {
                "model": "ml:layer_10"
            },
            "6": {
                "model": "ml:layer_12"
            },
            "7": {
                "model": "ml:layer_14"
            },
            "8": {
                "model": "ml:layer_16"
            }
        },
        "inventory": [{
            "model": "ml:layer_2",
            "transform": {
                "gui": {
                    "rotation": [{
                        "x": 30
                    }, {
                        "y": 225
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 0, 0],
                    "scale": 0.625
                },
                "ground": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 0
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 3, 0],
                    "scale": 0.1
                },
                "firstperson_righthand": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 45
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 4.2, 0],
                    "scale": 0.1
                },
                "firstperson_lefthand": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 225
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 4.2, 0],
                    "scale": 0.1
                }
            }
        }]
    }
}

 

The scale is 0.1 but it's still much larger than any other block

  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 27, 2018

Bump?

  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

Choonster    1651

Choonster

Choonster    1651

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1651
  • 5097 posts
Posted March 27, 2018

I'm not too sure, that looks right to me. Are you getting any errors in the log?

 

Try stepping through ForgeBlockStateV1.Variant.Deserializer#deserialize to see if it's recognising your transforms.

  • Quote

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 27, 2018 (edited)

I'm not getting any errors and after changing some values it does seem to work. I just need to continue changing values it hopefully will be good. It's totally guess work so it'll take a while.

 

EDIT: I tried converting the values with code:

Main.logger.warn(new TRSRTransformation(new ItemTransformVec3f(new Vector3f(0, 45, 0), new Vector3f(0, 4.2f, 0), new Vector3f(0.4f,0.4f,0.4f))).getTranslation());

 

But it just printed out the same values as in the constructor :C

Edited March 27, 2018 by MCrafterzz
  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 28, 2018

Does anyone know how to covert the vanilla values to forges? Multiple people have asked but I still haven't found a working answer.

  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 28, 2018

Bump

  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
Share on other sites

MCrafterzz    10

MCrafterzz

MCrafterzz    10

  • Diamond Finder
  • MCrafterzz
  • Members
  • 10
  • 285 posts
Posted March 29, 2018

Bump

  • Quote

width=700 height=200http://i.imgur.com/J4rrGt6.png[/img]

[Creator of mcrafterzz mod]

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Klarks
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks · Posted 2 minutes ago

      I get it but my container have a data parametr now   protected MyModContainer(int id, PlayerInventory playerInventory,World world,PacketBuffer data) { super(RegObj.MOD_CONTAINER.get(), id); this.playerInventory = new InvWrapper(playerInventory); world.getEntityByID( data.readInt()).getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { addSlot(new SlotItemHandler(h,0,79,18)); }); layoutPlayerInventory(7,54); }   and my anonymous inner class asks for data parametr  too. if i'll leave it null container wont work INamedContainerProvider iNamedContainerProvider = new INamedContainerProvider() { @Override public ITextComponent getDisplayName() { return new StringTextComponent("loh"); } @Nullable @Override public Container createMenu(int id, PlayerInventory playerInventory, PlayerEntity playerEntity) { return new MyModContainer(id,playerInventory, world,extraDataWriter); } };
    • diesieben07
      Use ${} in mods.toml

      By diesieben07 · Posted 10 minutes ago

      Correct.
    • diesieben07
      [1.16.*] Run Client/Server error

      By diesieben07 · Posted 11 minutes ago

      If you get that error you are using Java 15 still. However Forge has a recent update that should fix this.
    • diesieben07
      Party System

      By diesieben07 · Posted 12 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      [1.16.4] How i can open a container by clicking on my mob

      By diesieben07 · Posted 12 minutes ago

      Here you write the entity ID. Now you need to read it in your IContainerFactory.   That extraDataWriter stuff doesn't work and makes no sense.
  • Topics

    • Klarks
      36
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started Saturday at 09:56 PM

    • DoctorC
      7
      Use ${} in mods.toml

      By DoctorC
      Started 2 hours ago

    • Luis_ST
      1
      [1.16.*] Run Client/Server error

      By Luis_ST
      Started 1 hour ago

    • Discult
      1
      Party System

      By Discult
      Started 54 minutes ago

    • Luis_ST
      19
      [1.16.4] Edit Conversion Progress of Zombie Villager (Help with Java Reflection)

      By Luis_ST
      Started 5 hours ago

  • Who's Online (See full list)

    • diesieben07
    • Choonster
    • _HungTeen_
    • Klarks
    • Luis_ST
    • Thorius
    • Pl00py_R
    • Dragrise96
    • S-Spirit
    • loordgek
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Blockstate with item transforms doesn't load
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community