Jump to content

[1.10.2] Blockstates file makes block invisible


KeeganDeathman

Recommended Posts

I'm updating my multiblock file. When complete, the blocks all turn invisible and an obj loads. Except it doesn't. Passing in another block model instead also returns nothing. Commenting out or removing the code that makes it invisible has no effect, and the block still turns invisible.

In fact, I removed #shouldSideBeRendered and the ground is still rendered through the block. Odd.

package keegan.labstuff.blocks;

import keegan.labstuff.tileentity.TileEntityIndustrialMotorContact;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.*;
import net.minecraft.block.state.*;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.world.*;

public class BlockIndustrialMotorContact extends Block implements ITileEntityProvider
{

public static final PropertyBool VISIBLE = PropertyBool.create("visible");

@Override
public BlockStateContainer createBlockState()
{
	return new BlockStateContainer(this, new IProperty[]{VISIBLE});
}


public BlockIndustrialMotorContact(Material p_i45394_1_)
{
	super(p_i45394_1_);
	setDefaultState(getDefaultState().withProperty(VISIBLE, true));
}

//	@Override
//	public boolean isOpaqueCube(IBlockState state)
//	{
//		return state.getValue(VISIBLE);
//		
//	}

@Override
public int getMetaFromState(IBlockState state)
{
	return (state.getValue(VISIBLE) ? 1 : 0);
}

@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
	return EnumBlockRenderType.MODEL;
}

@Override
public IBlockState getStateFromMeta(int meta)
{
	return this.getDefaultState().withProperty(VISIBLE, meta > 0);
}


@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
	// TODO Auto-generated method stub
	return new TileEntityIndustrialMotorContact();
}

}

{
"forge_marker":1,
"defaults":
{
	"model":"labstuff:blockimotorcontact"
},
"variants":
{
	"visible":
	{
		"true":{"model":"labstuff:blockimotor"},
		"false":{}
	}
}
}

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

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.