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

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

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

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.