Jump to content

Model definition not found


Branone

Recommended Posts

My mod currently has several working blocks but I've been having problems trying to add a semi-animated block with different models in its blockstate. I believe it has to do with my naming conventions as I have three different names pertaining to this block.

 

The block I'm trying to add is a wardrobe which will soon have various wood types, but for now I'm trying to get an oak one working. I want the wardrobe to use the oak_wardrobe_closed model by default and then switch to oak_wardrobe_open when right-clicked. 

 

Console Error:

 

[quote][23:44:11] [Client thread/ERROR] [FML]: Exception loading model odm:block/oak_wardrobe_closed with loader instance, skipping
com.google.gson.JsonParseException: 'to' specifier exceeds the allowed boundaries: Vector3f[1.0, 33.0, 15.0]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.parsePositionTo(BlockPart.java:194) ~[blockPart$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.deserialize(BlockPart.java:80) ~[blockPart$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.deserialize(BlockPart.java:73) ~[blockPart$Deserializer.class:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
at com.google.gson.Gson.fromJson(Gson.java:868) ~[Gson.class:?]
at com.google.gson.Gson$1.deserialize(Gson.java:126) ~[Gson$1.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.getModelElements(ModelBlock.java:289) ~[ModelBlock$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:225) ~[ModelBlock$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:219) ~[ModelBlock$Deserializer.class:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
at com.google.gson.Gson.fromJson(Gson.java:741) ~[Gson.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:43) ~[ModelBlock.class:?]
at net.minecraft.client.resources.model.ModelBakery.loadModel(ModelBakery.java:250) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:89) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:871) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:129) [ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadAnyModel(ModelLoader.java:381) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.getModel(ModelLoader.java:362) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.resolveDependencies(ModelLoader.java:408) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadAnyModel(ModelLoader.java:382) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.getModel(ModelLoader.java:362) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:243) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:120) [ModelLoader.class:?]
at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:120) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:515) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:360) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:116) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
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_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[23:44:11] [Client thread/INFO] [FML]: Max texture size: 16384
[23:44:11] [Client thread/INFO]: Created: 16x16 textures-atlas
[23:44:12] [Client thread/ERROR] [FML]: Model definition for location odm:oak_wardrobe#normal not found
[23:44:12] [Client thread/INFO] [FML]: Injecting itemstacks
[23:44:12] [Client thread/INFO] [FML]: Itemstack injection complete
[23:44:12] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[23:44:12] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Oddments
[23:44:12] [Client thread/INFO]: SoundSystem shutting down...
[23:44:12] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[23:44:12] [sound Library Loader/INFO]: Starting up SoundSystem...
[23:44:13] [Thread-11/INFO]: Initializing LWJGL OpenAL
[23:44:13] [Thread-11/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[23:44:13] [Thread-11/INFO]: OpenAL initialized.
[23:44:13] [sound Library Loader/INFO]: Sound engine started
[23:44:15] [Client thread/ERROR] [FML]: Exception loading model odm:block/oak_wardrobe_closed with loader instance, skipping
com.google.gson.JsonParseException: 'to' specifier exceeds the allowed boundaries: Vector3f[1.0, 33.0, 15.0]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.parsePositionTo(BlockPart.java:194) ~[blockPart$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.deserialize(BlockPart.java:80) ~[blockPart$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.BlockPart$Deserializer.deserialize(BlockPart.java:73) ~[blockPart$Deserializer.class:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
at com.google.gson.Gson.fromJson(Gson.java:868) ~[Gson.class:?]
at com.google.gson.Gson$1.deserialize(Gson.java:126) ~[Gson$1.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.getModelElements(ModelBlock.java:289) ~[ModelBlock$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:225) ~[ModelBlock$Deserializer.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock$Deserializer.deserialize(ModelBlock.java:219) ~[ModelBlock$Deserializer.class:?]
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58) ~[TreeTypeAdapter.class:?]
at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
at com.google.gson.Gson.fromJson(Gson.java:741) ~[Gson.class:?]
at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:43) ~[ModelBlock.class:?]
at net.minecraft.client.resources.model.ModelBakery.loadModel(ModelBakery.java:250) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:89) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:871) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:129) [ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadAnyModel(ModelLoader.java:381) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.getModel(ModelLoader.java:362) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.resolveDependencies(ModelLoader.java:408) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadAnyModel(ModelLoader.java:382) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.getModel(ModelLoader.java:362) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:243) [ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:120) [ModelLoader.class:?]
at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:130) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:111) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:772) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:326) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:532) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:360) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:116) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
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_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[23:44:15] [Client thread/INFO] [FML]: Max texture size: 16384
[23:44:15] [Client thread/INFO]: Created: 512x512 textures-atlas
[23:44:15] [Client thread/ERROR] [FML]: Model definition for location odm:oak_wardrobe#normal not found
[23:44:17] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[/quote]

 

 

Code for the initialization of the blocks:

 

package branone.oddments.init;

import branone.oddments.Reference;
import branone.oddments.blocks.BlockFan;
import branone.oddments.blocks.BlockFlatscreenTV;
import branone.oddments.blocks.BlockFloorLamp;
import branone.oddments.blocks.BlockKettle;
import branone.oddments.blocks.BlockWardrobe;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class OddmentsBlocks {

public static Block kettle;
public static Block fan;
public static Block flatscreen_tv;
public static Block floor_lamp;
public static Block oak_wardrobe;

public static void init() {
	kettle = new BlockKettle(Material.iron).setUnlocalizedName("kettle");
	fan = new BlockFan(Material.rock).setUnlocalizedName("fan");
	flatscreen_tv = new BlockFlatscreenTV(Material.iron).setUnlocalizedName("flatscreen_tv");
	floor_lamp = new BlockFloorLamp(Material.cloth).setUnlocalizedName("floor_lamp");
	oak_wardrobe = new BlockWardrobe(Material.wood).setUnlocalizedName("oak_wardrobe");
}

public static void registerBlocks() {
	GameRegistry.registerBlock(kettle, kettle.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(fan, fan.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(flatscreen_tv, flatscreen_tv.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(floor_lamp, floor_lamp.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(oak_wardrobe, oak_wardrobe.getUnlocalizedName().substring(5));
}

public static void registerRenders() {
	registerRender(kettle);
	registerRender(fan);
	registerRender(flatscreen_tv);
	registerRender(floor_lamp);
	registerRender(oak_wardrobe);
}

public static void registerRender(Block block) {
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(Reference.MOD_ID + ":" + block.getUnlocalizedName().substring(5), "inventory"));
}
}

 

 

Names of the JSON files:

 

icTfcaY.png

 

 

Blockstate:

 

{
    "variants": {
        "facing=north,open=false": { "model": "odm:oak_wardrobe_closed"           },
        "facing=south,open=false": { "model": "odm:oak_wardrobe_closed", "y": 180 },
        "facing=east,open=false":  { "model": "odm:oak_wardrobe_closed", "y": 90  },
        "facing=west,open=false":  { "model": "odm:oak_wardrobe_closed", "y": 270 },
        "facing=north,open=true":  { "model": "odm:oak_wardrobe_open"           },
        "facing=south,open=true":  { "model": "odm:oak_wardrobe_open", "y": 180 },
        "facing=east,open=true":   { "model": "odm:oak_wardrobe_open", "y": 90  },
        "facing=west,open=true":   { "model": "odm:oak_wardrobe_open", "y": 270 }
    }
}

 

 

BlockWardrobe:

 

package branone.oddments.blocks;

import branone.oddments.OddmentsMod;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

public class BlockWardrobe extends Block {

public boolean open = false;

public BlockWardrobe(Material materialIn) {
	super(materialIn);
	this.setCreativeTab(OddmentsMod.tabOddments);
}

@Override
public boolean isOpaqueCube() {
	return false;
}

@Override
public boolean isFullCube() {
	return false;
}

}

 

Link to comment
Share on other sites

Also, posting code as images is stupid.  Use a [nobbc]

[/nobbc] tag instead, or pastebin, or github.

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.

Link to comment
Share on other sites

Also, posting code as images is stupid.  Use a [nobbc]

[/nobbc] tag instead, or pastebin, or github.

 
Personally I see it as easier to read as it emulates the environment where you'd usually read the code. I considered using a code tag originally but thought it would just be more comprehensible this way. I really see nothing 'stupid' about it but I'll keep your discontent towards images in mind next time. 
 
In other news, the coordinate error has been fixed however I am still left with the main one which this thread was intended to address. It is this specific error line which is messing up the rendering of my block and I am not sure how to fix it:
[code][03:21:49] [Client thread/ERROR] [FML]: Model definition for location odm:oak_wardrobe#normal not found

 

Link to comment
Share on other sites

Also, posting code as images is stupid.  Use a [nobbc]

[/nobbc] tag instead, or pastebin, or github.

 

Personally I see it as easier to read as it emulates the environment where you'd usually read the code.

 

On the other hand, it means that I can't copy the class into Eclipse and go "what is this? what is it doing?"

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.

Link to comment
Share on other sites

More of a "future reference" thing.

 

Anyway.

 

[03:21:49] [Client thread/ERROR] [FML]: Model definition for location odm:oak_wardrobe#normal not found

 

You don't have a normal variant specified.

E.g:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderores/blockstates/dummy_ore_zinc.json#L12

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.

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.



×
×
  • Create New...

Important Information

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