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
5 hours ago, 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

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

 

5 hours ago, 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.

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

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
2 hours ago, 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.

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

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

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/3/2019 at 6:24 PM, 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”)

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

 

Spoiler

[20:42:02] [main/ERROR] [FML]: Exception loading model for variant madengineering:blocksyngasgenerator#normal for blockstate "madengineering:blocksyngasgenerator"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model madengineering:blocksyngasgenerator#normal with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_144]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1175) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?]
	... 21 more

 

 

 

Posted (edited)
10 minutes ago, ChakatStormCloud said:

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

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/4/2019 at 8:54 PM, 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.

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

Spoiler

 


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

 

 

 

 
 

 

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.