Jump to content

[SOLVED] transparency+ opacity in same model. What am I doing wrong?


Recommended Posts

Posted

I been trying to get this working for at least a month now. I can never figure out exactly what I am doing wrong why I can't make a multi-layer block

 

I got a crystall ball. I want the ball to be transparent but base to be opaque.

 

here is what I got so far. Nothing renders btw. Is just one big default tex cube.  But each individual piece is correct i just can't put it together.

 

 

my blockstate json:

 

{
"forge_marker": 1,
"defaults": {
	"model": "forge:multi-layer",
	"custom": {
		"base": "technorcery:crystal_ball#base",
		"Solid": "technorcery:crystal_ball#base",
		"Translucent": "technorcery:crystal_ball#ball"
	},
	"transform": "forge:default-block"
},
  "variants": {
    "normal": [{}],
    "inventory": [{}],
    "facing": {
      "north": { },
      "south": {"y": 180},
      "west": {"y": 270},
      "east": {"y": 90}
    },
    "base": [{
      "model": "technorcery:crystal_ball_base"
    }],
    "ball": [{
      "model": "technorcery:crystal_ball_ball"
    }]
  }
}

 

 

my ball json:

 

{
    "textures": {
        "glass": "blocks/glass_blue"
    },
    "elements": [
        {
            "from": [ 4.0, 3.0, 4.0 ], 
            "to": [ 12.0, 11.0, 12.0 ], 
            "faces": {
                "north": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
                "east": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
                "south": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
                "west": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
                "up": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] },
                "down": { "texture": "glass", "uv": [ 0.0, 0.0, 8.0, 8.0 ] }
            }
        }
    ]
}

 

 

my base json

 

{
    "textures": {
        "base": "blocks/gold_block"
    },
    "elements": [
        {
            "from": [ 5.0, 2.0, 5.0 ], 
            "to": [ 11.0, 3.0, 11.0 ], 
            "faces": {
                "north": { "texture": "base", "uv": [ 1.0, 1.0, 7.0, 2.0 ] },
                "east": { "texture": "base", "uv": [ 1.0, 1.0, 7.0, 2.0 ] },
                "south": { "texture": "base", "uv": [ 1.0, 1.0, 7.0, 2.0 ] },
                "west": { "texture": "base", "uv": [ 1.0, 1.0, 7.0, 2.0 ] },
                "up": { "texture": "base", "uv": [ 1.0, 1.0, 7.0, 7.0 ] },
                "down": { "texture": "#-1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
            }
        },
        {
            "from": [ 4.0, 1.0, 4.0 ], 
            "to": [ 12.0, 2.0, 12.0 ], 
            "faces": {
                "north": { "texture": "base", "uv": [ 2.0, 1.0, 10.0, 2.0 ] },
                "east": { "texture": "base", "uv": [ 1.0, 1.0, 9.0, 2.0 ] },
                "south": { "texture": "base", "uv": [ 1.0, 1.0, 9.0, 2.0 ] },
                "west": { "texture": "base", "uv": [ 1.0, 1.0, 9.0, 2.0 ] },
                "up": { "texture": "base", "uv": [ 1.0, 1.0, 9.0, 9.0 ] },
                "down": { "texture": "#-1", "uv": [ 1.0, 1.0, 9.0, 9.0 ] }
            }
        },
        {
            "from": [ 3.0, 0.0, 3.0 ], 
            "to": [ 13.0, 1.0, 13.0 ], 
            "faces": {
                "north": { "texture": "base", "uv": [ 2.0, 1.0, 12.0, 2.0 ] },
                "east": { "texture": "base", "uv": [ 1.0, 1.0, 11.0, 2.0 ] },
                "south": { "texture": "base", "uv": [ 1.0, 1.0, 11.0, 2.0 ] },
                "west": { "texture": "base", "uv": [ 1.0, 1.0, 11.0, 2.0 ] },
                "up": { "texture": "base", "uv": [ 1.0, 1.0, 11.0, 11.0 ] },
                "down": { "texture": "base", "uv": [ 1.0, 1.0, 11.0, 11.0 ] }
            }
        }
    ]
}

 

 

my java code

 

public class CrystalBall extends Block
{
public static final AxisAlignedBB CRYSTAL_BALL_AABB = new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 0.6875D, 0.75D);

public CrystalBall(String name) {
	super(Material.GLASS);
	this.setUnlocalizedName(Technorcery.MODID + ":" + name);
	this.setRegistryName(name);
	this.setCreativeTab(ModData.CREATIVE_TAB);
}

@Override
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

@Override
    public boolean isFullCube(IBlockState state)
    {
        return false;
    }

@Override
    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return CRYSTAL_BALL_AABB;
    }

@Override
    public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer)
    {
        return true;
    }

}

 

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

Posted

Guys an update.

 

 

I placed the block in mid air and tried to step inside it. It seems to actually be a real properly working model inside but somehow something is rendered as a default texture cube around it all. Not sure exactly what's wrong. Perhaps the transform is not good?

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

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.