Jump to content

Recommended Posts

Posted

Hello

 

Alright, I'm trying to make a transparent block. I know about creating blocks etc, and I have done the usual thing. I made a texture with transparency in PAINT.NET, and this is what I did inside my BlockCompactGlass:

 

public class BlockCompactGlass extends Block {
public BlockCompactGlass(int par1, Material par2Material) {
	super(par1, par2Material);
	this.setCreativeTab(CCMain.compactTab);
}

public int quantityDropped(Random par1Random) {
	return 0;
}

@SideOnly(Side.CLIENT)
@Override
public boolean isOpaqueCube() {
	return false;
}


@Override
public boolean renderAsNormalBlock() {
	return false;
}

@Override
    public int getRenderBlockPass()
{
            return 1;
}
protected boolean canSilkHarvest() {
	return true;
}

public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess,
		int par2, int par3, int par4, int par5)

{

	int i = par1IBlockAccess.getBlockId(par2, par3, par4);

	return i == blockID ? false : true;
}


}

 

 

And this is what it looks like ingame:

 

 

sbxgK9d.png

 

 

As you can see the block on the left is mine, and it does not render water. It also does not show up as transparent in the hotbar.

 

Any help with my issue would be appreciated. I am using forge (build number 7.7.0.604).

 

Thanks,

Moony22

Compact Crafting-The best way to store all your excess items!

Posted

Alright, thanks for the link. How do I use this with my mod(I'm new to github)? Also, is there any fix for the hot bar as well?

Compact Crafting-The best way to store all your excess items!

Posted

Oh Okay, thanks. But how is Minecraft Glass transparent in the hotbar? I've looked at the code for BlockGlass.

Compact Crafting-The best way to store all your excess items!

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.