Jump to content

[1.8.9] variants rotations on OBJ model


juanitodelavega

Recommended Posts

I have a block with facing state and cutom OBJ model, i cannot figure how to rotate the different variants, i tried to put "y"=angle everywhere and its not working, btw my block is not a tile entity.

 

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "#None": "mymodid:blocks/controlpanel"
        },
        "model": "mymodid:controlpanel.obj"
     },
    "variants": {
        "facing=north": [{"y":180}],
        "facing=south": [{"y":90}],
        "facing=east": [{"y":0}],
        "facing=west": [{"y":270}],
        "facing=up": [{}],
        "facing=down": [{}],
        "normal": [{}],
        "inventory": [{
            "transform": {
                    "translation": [ 0, 0, 0],
                    "scale": 1.0
                }
        }]
    }
}

 

I don t know if there is another method to specify variants rotation ?

Link to comment
Share on other sites

There may be another way but, here is a trimmed down version of what I'm using.

 

@Override
protected BlockState createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[] { <Non Facing Properties> }, new IUnlistedProperty[] { OBJModel.OBJProperty.instance });
}

@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
{
    OBJModel.OBJState newState;
    newState = new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true, new TRSRTransformation(TRSRTransformation.getMatrix(EnumFacing.NORTH)));
    return ((IExtendedBlockState)state).withProperty(OBJModel.OBJProperty.instance, newState);
}

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.