Jump to content

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


peter1745

Recommended Posts

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? :(

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Wow this looks a lot simpler than I thought it would be. Especially compared to the setup I had to do for capabilities. I'll look at all this and update if I have any issues ty
    • Me and a group of friends were trying to get a modpack to work so we can play together. It works for everyone else, except me. At first when I tried to import the modpack, it said "invalid file" but it didn't with anyone else's. The owner of the modpack resent it several times and I still kept getting the same issue, so I opened the modlist and downloaded every single mod by hand. I thought that it would resolve the issue, but instead, it started saying "Forge Modloader Installation Failed" after I created a new installation, so I tried to use a pre-existing modpack, made sure it was the same version "1.20.1, forge version 47.3.0" and swap the mods there, but it still had the same issue, and now none of my modpacks are working at all. They all keep saying that the modloader installation failed. None of us have any idea what to do as we aren't the techiest people. Any help is appreciated. Thank you!
    • I don't think there's any documentation on them yet, I mainly just looked at the Vanilla code when implementing mine. You can see a fairly simple example here: Registration: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/f3bea10d5f455fa0904056caafd8c844b6fd13ae/src/main/java/choonster/testmod3/init/ModDataComponents.java#L50-L58 Item Registration: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/f3bea10d5f455fa0904056caafd8c844b6fd13ae/src/main/java/choonster/testmod3/init/ModItems.java#L264-L266 Usage: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/f3bea10d5f455fa0904056caafd8c844b6fd13ae/src/main/java/choonster/testmod3/world/item/EntityCheckerItem.java
    • Okay, I'm glad I made a backup then. I'm confused as to where there is any information on how to work with Data Components. I don't see anything about it on the Forge docs or any tutorials on this in general unless I'm missing it somehow. I can see the DataComponents decompiled class file but I'm not sure how to work with it. Maybe it's beyond my technical expertise?
    • The situation is the same in 1.20.6. Data Components were introduced in 1.20.5/1.20.6 and Item Capabilities haven't been re-implemented since then.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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