Jump to content

Recommended Posts

Posted

Ok so the title basically says it all: how can I create a non-standard block (block that is not a full 1 * 1 * 1 opaque cube) like an anvil, torch, repeater, etc from vanilla minecraft. I have looked in all of the relevant code but I didn't understand it further than fact that they all had these booleans and different textures for each side / part of the block.

public boolean renderAsNormalBlock() {

    return false;

}

public boolean isOpaqueCube() {

    return false;

}

I have included both booleans in my code and have the following code rendering the different textures for the top, side and bottom of the block:

protected IIcon MagStandBottom;

protected IIcon MagStandSide;

protected IIcon MagStandTop;

        @Override

public void registerBlockIcons(IIconRegister p_149651_1_) {

MagStandBottom = p_149651_1_.registerIcon("techcraft:MagStandBottom");

MagStandSide = p_149651_1_.registerIcon("techcraft:MagStandSide");

MagStandTop = p_149651_1_.registerIcon("techcraft:MagStandTop");

}

@Override

public IIcon getIcon(int side, int metadata)

{

if (side == 0) {

return MagStandBottom;

}

else if (side==1) {

return MagStandTop;

}

else {

return MagStandSide;

}

}

It renders the different sides and I can't place torches or redstone on it, but how can move the sides inwards or have legs on it (like the cauldron)?

Thanks for helping,

Toastrackenigma

Posted

Make a class implementing

ISimpleBlockRendererHandler

, and register this handler. There should be tutorials on the subject.

 

Also, please use [ code ] tags for short snippets of code, and gists for longer snippets with line numbers and syntax highlighting.

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.