Jump to content

[1.12.2][SOLVED]texture opacity in a custom block model json not supported?


tebreca

Recommended Posts

Hello,

Im working on a block with fluids inside it,

I made a model for it with glass so you can see what fluid is inside it, this is how it looks in the world and in my hand:

Spoiler

5a44c64c3a4e4_Knipsel(2).PNG.b4e805acfc7243960e5fb5a9017b349e.PNGKnipsel.PNG.2ce9c31fdeccf33edc716d9b611aa53d.PNG

as you can see it works when i hold it

My code for the model file

{
    "textures": {
        "0": "eaglesess:machines/factory_table_side",
        "1": "eaglesess:machines/liquid_absorber_side",
        "2": "eaglesess:machines/wooden_casing",
        "3": "eaglesess:machines/liquid_absorber_top",
        "4": "eaglesess:machines/liquid_absorber_liquid"
    },
    "elements": [
        {
            "name": "Cube",
            "from": [ 15.0, 0.0, 0.0 ], 
            "to": [ 16.0, 16.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 15.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 1.0, 0.0, 15.0 ], 
            "to": [ 16.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 1.0 ] },
                "down": { "texture": "#2", "uv": [ 16.0, 1.0, 0.0, 0.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 0.0, 0.0, 0.0 ], 
            "to": [ 15.0, 16.0, 1.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 15.0, 0.0, 16.0, 16.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 1.0, 0.0, 0.0, 16.0 ] },
                "up": { "texture": "#2", "uv": [ 16.0, 15.0, 2.0, 16.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Cube",
            "from": [ 0.0, 0.0, 1.0 ], 
            "to": [ 1.0, 16.0, 16.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "east": { "texture": "#1", "uv": [ 0.0, 0.0, 15.0, 16.0 ] },
                "south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 16.0 ] },
                "west": { "texture": "#1", "uv": [ 1.0, 0.0, 16.0, 16.0 ] },
                "up": { "texture": "#3", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
                "down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 15.0 ] }
            }
        },
        {
            "name": "Bottom",
            "from": [ 1.0, 0.0, 1.0 ], 
            "to": [ 15.0, 1.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#0", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, -5.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, -13.0, -13.0 ] },
                "up": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Fluid",
            "from": [ 1.0, 1.0, 1.0 ], 
            "to": [ 15.0, 15.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "east": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "south": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "west": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "up": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#4", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        },
        {
            "name": "Top",
            "from": [ 1.0, 15.0, 1.0 ], 
            "to": [ 15.0, 16.0, 15.0 ], 
            "faces": {
                "north": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "east": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "south": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "west": { "texture": "#2", "uv": [ 0.0, 0.0, 14.0, 1.0 ] },
                "up": { "texture": "#3", "uv": [ 1.0, 1.0, 15.0, 15.0 ] },
                "down": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
            }
        }
    ]
}

 

My Forge blockstate file:

{
	"forge_marker": 1,
	"defaults": {
		"model": "eaglesess:liquid_collector"
	},
	"variants": {
		"normal": [{}],
		"inventory": [{}]
	}
}

 

I added some methods to the block:

public static BlockBase fluidcollector = new BlockBase("fluid_collector", Material.WOOD, Main.blocksTab, 1) {
		
		@Override
		public boolean isOpaqueCube(net.minecraft.block.state.IBlockState state) {
			return true;
		};
	    public boolean isFullCube(IBlockState state)
	    {
	        return false;
	    }
		
	};

thx

Edited by tebreca
its solved
Link to comment
Share on other sites

 

1 hour ago, tebreca said:

as you can see it works when i hold it

nope, on the fact that the images are very small, and very dark.

 

Try and override the Client-Side only method Block::getBlockLayer, and return BlockRenderLayer#CUTOUT, like Glass.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

8 hours ago, tebreca said:

as you can see it works when i hold it

/time set 2000

Then take screenshots.

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

for the people watching this with the same question

 

heres what ive got

 @SideOnly(Side.CLIENT)
	    @Override
	    public net.minecraft.util.BlockRenderLayer getBlockLayer() {
	    	return BlockRenderLayer.TRANSLUCENT;
	    }

notice that this is kinda laggy for low end graphics cards

This is better and less graphics card heavy, but it will write you rexture just to a full cube, meaning it not like glass anymore and you cant see trough the block

 @SideOnly(Side.CLIENT)
	    @Override
	    public net.minecraft.util.BlockRenderLayer getBlockLayer() {
	    	return BlockRenderLayer.CUTOUT_MIPPED;
	    }

 

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.