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.

Featured Replies

Posted

I make a block that has a partially transparent texture and I want it be clear like glass is. I copied the glass code and now my block sees right through the ground. How would I fix this?

 

Here is pictures of this and my code:

 

http://image.prntscr.com/image/a8f16eeef55a43c6bbf48f06e431de65.png

 

http://image.prntscr.com/image/c12682e8b9a34e24aadc3829689e1884.png

 

The block code:


public class BlockMachineFrame extends BlockBase {
    public BlockMachineFrame() {
        super(Material.IRON, "machine_frame");

        setHardness(3f);
        setResistance(5f);
        setHarvestLevel("pickaxe", 0);
    }

    @Override
    public BlockMachineFrame setCreativeTab(CreativeTabs tab) {
        super.setCreativeTab(tab);
        return this;
    }

    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT;
    }

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

 

The blockstate file:


{
  "forge_marker": 1,
  "defaults": {
    "textures": {
      "all": "roboticraft:blocks/machine_frame"
    }
  },
  "variants": {
    "normal": {
      "model": "cube_all"
    },
    "inventory": {
      "model": "cube_all"
    }
  }
}

Edited by Awesome_Spider

Try to override:

 public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {}

 

In the BlockGlass class you can see its extends from BlockBreakable which override this too.

Lhykos: that says whether or not this block renders sides, not adjacent blocks.

 

This is what's missing:

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

Also, make sure you annotate all override methods with @Override

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.

1 minute ago, Draco18s said:

This is what's missing:


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

 

Ok, thanks for the help.

 

2 minutes ago, Draco18s said:

Also, make sure you annotate all override methods with @Override

Oops. I knew that, just missed one of them.

That fixed it. Thanks

9 minutes ago, Awesome_Spider said:

Oops. I knew that, just missed one of them.

Two, actually: isFullCube and BlockRenderLayer.

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.

Lol, oops. Thanks for pointing that out.

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.