Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.10.2] Blockstates file makes block invisible

Featured Replies

Posted

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]

  • Author

Attention all.

I have realized that I was turning them all into motor shafts, thus why my edits to the contact code had no effect.

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

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.