Jump to content

Recommended Posts

Posted

I've been having an issue where my blocks won't have a placed block render unless they have a resources/assets/<modid>/blockstates/*.json

Their renders work fine in the inventory, and when held, but not when placed.

 

I have 3 blocks that are relevant.

 

I have an ore block that uses damage and enum type property to determine the correct model/texture. It rendered fine with it's existing blockstate json.

{
	"variants": {
		"type=copper": {"model": "madengineering:blockOre_copper"},
		"type=nickel": {"model": "madengineering:blockOre_nickel"},
		"type=chrome": {"model": "madengineering:blockOre_chrome"},
		"type=tungsten": {"model": "madengineering:blockOre_tungsten"}
	}
}

 

I have a simple custom model block that I had to add a basic blockstate json for it to work.

{
    "variants": {
        "normal": {"model": "madengineering:blockframe"}
    }
}

 

And I have a much more complicated model with facing and an on/off state that's using the forge blockstate, and I have no idea how to fix it.

{
  "forge_marker": 1,
  "defaults": {
    "model": "madengineering:blocks/blocksyngasgenerator"
  },
  "variants": {
    "hasfuel": {
      "true": {
        "textures": {
          "fuel": "blocks/planks_oak"
        }
      },
      "false": {
        
      }
    },
    "facing": {
      "north": {
        "y":0
      },
      "east": {
        "y":90
      },
      "south": {
        "y":180
      },
      "west":{
        "y":270
      }
    }
  }
}

 

 

The frame is the two you see, I'm having some trouble with them registering as full blocks even though they're set as transparent.

The errored block is the same as the one I'm holding, and is floating above it, so it has a working model.

2019-02-01_22_26_38.thumb.png.165db9cf004f5ec5bb7ae7889359992b.png

 

Posted
  On 2/2/2019 at 5:30 AM, ChakatStormCloud said:

I've been having an issue where my blocks won't have a placed block render unless they have a resources/assets/<modid>/blockstates/*.json

Expand  

That's how block rendering works, it needs a blockstate file. The blockstate file resolves the blockstate of a block to a model.

 

  On 2/2/2019 at 5:30 AM, ChakatStormCloud said:

The frame is the two you see, I'm having some trouble with them registering as full blocks even though they're set as transparent.

Expand  

Define "registering as full blocks". They are full blocks. If you mean the adjacent blocks having the sides touching the frames be transparent you need to override Block#isOpaqueCube and return false.

 

As for the missing model block post your startup log, it should contain an error related to it.

Posted (edited)
  On 2/2/2019 at 10:32 AM, V0idWa1k3r said:

That's how block rendering works, it needs a blockstate file. The blockstate file resolves the blockstate of a block to a model.

 

Define "registering as full blocks". They are full blocks. If you mean the adjacent blocks having the sides touching the frames be transparent you need to override Block#isOpaqueCube and return false.


As for the missing model block post your startup log, it should contain an error related to it.

Expand  
3

Okay, I figured the blockstates file was only needed if the block had different states.

 

Really? I figured this.translucent=true; would fix that, but alright.

 

I've looked through the startup log 100 times, but there's only a bunch of errors relating to my items that I haven't made textures for yet. itemIngot and itemComponent, nothing related to blockSyngasGenerator.

but here it is: https://pastebin.com/Tfjhq67d

Edited by ChakatStormCloud
Posted
  On 2/3/2019 at 11:10 PM, ChakatStormCloud said:

I've looked through the startup log 100 times, but there's only a bunch of errors relating to my items that I haven't made textures for yet. itemIngot and itemComponent, nothing related to blockSyngasGenerator.

Expand  

Fix those errors first then, it caps the amount of errors it spits into the log to reduce spam (you should see something like “suppressed an additional X errors for the domain youModID”)

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 2/4/2019 at 1:24 AM, Cadiboo said:

Fix those errors first then, it caps the amount of errors it spits into the log to reduce spam (you should see something like “suppressed an additional X errors for the domain youModID”)

Expand  

4 hours of creating textures later.... and I have just the one error

 

  Reveal hidden contents
 

 

Posted (edited)
  On 2/5/2019 at 3:47 AM, ChakatStormCloud said:

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

Expand  

There's more, as this error is only thrown if another error occurs, unless your blockstate json file is missing the desired variant.

 

Which, it likely is, seeing as that error is for the normal variant and your supplied blockstate file does not have a normal variant.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
  On 2/5/2019 at 3:54 AM, Draco18s said:

There's more, as this error is only thrown if another error occurs, unless your blockstate json file is missing the desired variant.

 

Which, it likely is, seeing as that error is for the normal variant and your supplied blockstate file does not have a normal variant.

Expand  

Yeah, that's the ONLY error, meaning you're right about the normal variant.

 

After 30 minutes of looking up the way forge blockstates are supposed to handle the normal variant when using the defaults statement....


this is what I got and it works finally

  Reveal hidden contents
 
 

 

EDIT:

and for anyone interested, the frame was fixed with overriding the isOpaqueCube() and returning false (as suggested), and also setting useNeighborBrightness = true; so it would light the inside of the block correctly and pass light through.

Edited by ChakatStormCloud

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.