Jump to content

[1.11.2] (SOLVED) Forge can't seem to find my blockstate file.


Misero

Recommended Posts

Here is the entire log that Minecraft is giving me: https://pastebin.com/iqSQLL9a

 

And the errors in my blockstate file: 

Spoiler
  1. [12:52:42] [Client thread/ERROR] [FML]: Exception loading model for variant machinate:machine#normal for blockstate "machinate:machine"
  2. net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model machinate:machine#normal with loader VariantLoader.INSTANCE, skipping
  3.     at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
  4.     at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:264) ~[ModelLoader.class:?]
  5.     at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
  6.     at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:252) ~[ModelLoader.class:?]
  7.     at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:159) ~[ModelLoader.class:?]
  8.     at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
  9.     at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
  10.     at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
  11.     at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
  12.     at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
  13.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
  14.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
  15.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
  16.     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
  17.     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
  18.     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
  19.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
  20.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
  21.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
  22.     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
  23.     at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
  24.     at GradleStart.main(GradleStart.java:26) [start/:?]
  25. Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
  26.     at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
  27.     at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1257) ~[ModelLoader$VariantLoader.class:?]
  28.     at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
  29.     ... 21 more
  30. [12:52:42] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant machinate:machine#normal:
  31. java.lang.Exception: Could not load model definition for variant machinate:machine
  32.     at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:297) ~[ModelLoader.class:?]
  33.     at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[ModelBakery.class:?]
  34.     at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:252) ~[ModelLoader.class:?]
  35.     at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:159) ~[ModelLoader.class:?]
  36.     at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
  37.     at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
  38.     at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?]
  39.     at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?]
  40.     at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
  41.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
  42.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
  43.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
  44.     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
  45.     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
  46.     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
  47.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
  48.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
  49.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
  50.     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
  51.     at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
  52.     at GradleStart.main(GradleStart.java:26) [start/:?]
  53. Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model machinate:blockstates/machine.json
  54.     at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:228) ~[ModelBakery.class:?]
  55.     at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
  56.     at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:293) ~[ModelLoader.class:?]
  57.     ... 20 more
  58. Caused by: java.io.FileNotFoundException: machinate:blockstates/machine.json
  59.     at net.minecraft.client.resources.FallbackResourceManager.getAllResources(FallbackResourceManager.java:104) ~[FallbackResourceManager.class:?]
  60.     at net.minecraft.client.resources.SimpleReloadableResourceManager.getAllResources(SimpleReloadableResourceManager.java:79) ~[SimpleReloadableResourceManager.class:?]
  61.     at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:221) ~[ModelBakery.class:?]
  62.     at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?]
  63.     at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:293) ~[ModelLoader.class:?]
  64.     ... 20 more

The relevant directory structure: fhnULKU.png

blockstates/machine.json: 

Spoiler

{
    "variants": {
        "normal": { "model": "machinate:machine" }
    }
}
 

item/machine.json: 

Spoiler

{
    "parent": "block/cube_all",
    "textures": {
        "all": "machinate:blocks/furnace"
    }
}

block/machine.json: 

Spoiler

{
    "parent": "block/cube_all",
    "textures": {
        "all": "machinate:blocks/furnace"
    }
}

Screenshot of block's appearance: WUxzyHo.png

(Note that I am holding the block in this screenshot.)

Contents of my block registration class:

Spoiler

package init;

import com.miseromc.machinate.blocks.BlockMachine;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ModBlocks {
    public static Block machine;
    
    public static void init(){
        machine = new BlockMachine();
    }
    public static void register(){
        GameRegistry.register(machine);
        GameRegistry.register(new ItemBlock(machine), machine.getRegistryName());
    }
    public static void registerRenders(){
        registerRender(machine);
    }
    private static void registerRender(Block block){
        Item item = Item.getItemFromBlock(block);
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));
    }
}
 

Contents of BlockMachine.java: 

Spoiler

package com.miseromc.machinate.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumBlockRenderType;

public class BlockMachine extends Block{
    public BlockMachine(){
        super(Material.IRON);
        setUnlocalizedName("machine");
        setRegistryName("machine");
    }
}

And the contents of my main class: 

Spoiler

package com.miseromc.machinate;

import com.miseromc.machinate.proxy.CommonProxy;

import init.ModBlocks;
import init.ModItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;


@Mod(modid = Reference.MOD_ID, name=Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions=Reference.ACCEPTED_VERSIONS)

public class Machinate {
    @Instance
    public static Machinate instance;
    @SidedProxy(clientSide=Reference.CLIENT_PROXY_CLASS, serverSide = Reference.CLIENT_PROXY_CLASS)
    public static CommonProxy proxy;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event){
        ModItems.init();
        ModItems.register();
        ModBlocks.init();
        ModBlocks.register();
    }
    
    @EventHandler
    public void Init(FMLInitializationEvent event){
        proxy.init();
        FMLCommonHandler.instance().bus().register(new MachinateEvents());
    }
    
    @EventHandler
    public void PostInit(FMLPostInitializationEvent event){
        
    }
    
}

(Sorry if this post is a bit long, but I wanted to include everything because I have no clue what is causing this.)

Edited by Misero
Forgot to include version of all things.
Link to comment
Share on other sites

Additionaly some potential issues which are not directly related to your problem but are still worth fixing:

28 minutes ago, Misero said:

Minecraft.getMinecraft().getRenderItem().getItemModelMesher()

ItemModelMesher is outdated and buggy. Use ModelLoader. And register your models in your client proxy during pre-init or in a ModelRegistryEvent(prefered)

 

 

31 minutes ago, Misero said:

serverSide = Reference.CLIENT_PROXY_CLASS

?

 

  • Like 1
Link to comment
Share on other sites

10 minutes ago, Jay Avery said:

From this picture, it looks like the blockstates directory is directly inside the assets directory, rather than inside assets.modid alongside lang, models, and textures like it should be.

Oh god, I'm stupid. Thanks.

8 minutes ago, V0idWa1k3r said:

Additionaly some potential issues which are not directly related to your problem but are still worth fixing:

ItemModelMesher is outdated and buggy. Use ModelLoader. And register your models in your client proxy during pre-init or in a ModelRegistryEvent(prefered)

 

 

?

 

See above. I probably should not have been making this at 1 am. 

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.