Jump to content

[Solved][1.9.4] Placed block is invisible


mmdanggg2

Recommended Posts

I am trying to update my mod into 1.9 and have sorted through all the errors and now, after getting in game, one of my blocks is not rendering at all.

 

lX47LIX.png

 

As you can see the block, when placed, is not there. However the item for the block is displaying as intended.

 

blockstates/miningRig.json:

{
    "variants": {
        "facing=north": { "model": "doge:miningRig" },
        "facing=south": { "model": "doge:miningRig", "y": 180 },
        "facing=west":  { "model": "doge:miningRig", "y": 270 },
        "facing=east":  { "model": "doge:miningRig", "y": 90 }
    }
}

 

models/block/miningRig.json:

{
    "parent": "block/cube",
    "textures": {
        "particle": "doge:blocks/miningRigFrontOff",
        "up": "doge:blocks/miningRigTopBackOff",
        "down": "doge:blocks/miningRigBottom",
        "south": "doge:blocks/miningRigTopBackOff",
        "north": "doge:blocks/miningRigFrontOff",
        "east": "doge:blocks/miningRigSideOff",
        "west": "doge:blocks/miningRigSideOff"
    }
}

 

models/items/miningRig.json:

{
    "parent": "doge:block/miningRig"
}

 

models registered with:

ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(Doge.miningRig), 0, new ModelResourceLocation(Doge.miningRig.getRegistryName(), "inventory"));

 

The other block I have is working fine although it has no block states and simply uses block/cube_all model

 

full source available here: https://github.com/mmdanggg2/DogeMod/tree/1.9.4

I have a youtube if you care:

https://www.youtube.com/c/mmdanggg2

Link to comment
Share on other sites

BlockContainer

overrides

Block#getRenderType

to return

EnumBlockRenderType.INVISIBLE

, which prevents the standard baked model from being rendered (so the model can be rendered by a

TESR

).

 

You could override

Block#getRenderType

to return

EnumBlockRenderType.MODEL

(like various vanilla blocks with

TileEntities

do), but the best way around this is to not extend

BlockContainer

at all. Instead, override

Block#hasTileEntity(IBlockState)

and

Block#createTileEntity

.

 

MiningRig

has a

getRenderType

method returning 3, but this no longer overrides

Block#getRenderType

in 1.9+. Always annotate override methods with

@Override

. If this gives you a compilation error, fix the method signature rather than removing the annotation.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.

Announcements



×
×
  • Create New...

Important Information

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