Jump to content

[1.8][SOLVED] Problem with rendering of smaller blocks


Recommended Posts

Posted

Hello! I am trying to make a custom block that is smaller then a normal block, it's supposed to be 13px high instead of 16px, and it kinda works.

I am able to make the side of the blocks stop rendering at 13px, but then the top of the block goes all black, and when I stand on it the sky turns black as well??? Oh and I have changed the hitbox so that it's 0.8f instead of 1.0f in the code.

 

Here is the .json code that i'm using:

 

The parent json:

  {

      "textures": {

            "particle": "#all"

      },

      "elements": [

            {

                "from": [0, 0, 0],

                "to": [16, 13, 16],

                "faces": {

                      "down": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "up": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "north": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "south": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "west": {"uv": [0, 0, 16, 13], "texture": "#all"},

                      "east": {"uv": [0, 0, 16, 13], "texture": "#all"}

                }

            }

      ]

  }

 

the block json:

  {

        "parent": "mymodid:block/parentjson",

        "textures": {

            "all": "mymodid:blocks/myblock"

        }

  }

 

Can anyone tell what the h i'm doing wrong? :(

Posted

hi

 

Have you overridden Block.isOpaqueCube and .isFullCube?

 

  // used by the renderer to control lighting and visibility of other blocks.
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isOpaqueCube() {
    return false;
  }

  // used by the renderer to control lighting and visibility of other blocks, also by
  // (eg) wall or fence to control whether the fence joins itself to this block
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isFullCube() {
    return false;
  }

 

-TGG

 

Posted

hi

 

Have you overridden Block.isOpaqueCube and .isOpaqueCube?

 

  // used by the renderer to control lighting and visibility of other blocks.
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isOpaqueCube() {
    return false;
  }

  // used by the renderer to control lighting and visibility of other blocks, also by
  // (eg) wall or fence to control whether the fence joins itself to this block
  // set to false because this block doesn't fill the entire 1x1x1 space
  @Override
  public boolean isFullCube() {
    return false;
  }

 

-TGG

 

No I didn't override the isOpaqueCube method, but I did override the isFullCube, thank you!

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.