简体   繁体   中英

Minecraft mod 1.12.2 glass bug

I'm doing a simple Minecraft mod, but I have problem with custom glass block:

https://1drv.ms/u/s!AqlbJB4d16OZu0TtNAG68on1C3EN?e=Fl9Ecv

Block under,and behind glass block are visible. How can I fix it?

if there is space between next block is visible: https://1drv.ms/u/s!AqlbJB4d16OZu0X-Wjd-hx3_wGEF?e=LQoAao

public class HardGlass extends BlockBase
{

    public HardGlass(String name, Material material) 
    {
        super(name, material);
        
        setSoundType(SoundType.GLASS);
        setHardness(600.0F);
        setResistance(100.0F);
        setHarvestLevel("pixaxe",3);
        setLightOpacity(1);
        
    }
    
    
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT;
    }

    public boolean isFullCube(IBlockState state)
    {
        return true;
    }
}

为 isFullCube 返回 false 以便 MC 将渲染它周围的块。

Adding this solved the problem, and I can still put doors on it ;)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM