Jump to content

Recommended Posts

Posted

Hi,

 

I've got a small problem:

 

I've got a block which has no texture. So I want to use the vanilla texture just for testing until I'm able to get some textures done... (not that good at pixel art)

So what am I doing wrong?

 

blockstates.json

{
    "forge_marker": 1,
    "defaults": {
    },
    "variants": {
        "stone": {
            "andesite": { "model": "minecraft:stone" }
        }
    }
}

 

Java code BlockStates:

public static PropertyEnum<StoneType> META_PROPERTY = PropertyEnum.create("stone", StoneType.class);

 

This results in a block with the "missing texture" texture.

 

Thx in advance.

Bektor

Developer of Primeval Forest.

Posted

use this for your model:

{

    "parent": "block/cube_all",

    "textures": {

        "all": "blocks/stone"

    }

}

and for your blockstates you have to use this:

 

{

    "variants": {

        "normal": { "model": "name of the model above" }

    }

}

 

Posted

The FML log should tell you exactly what went wrong. If you don't know what to make of it, upload it to Gist and link it here.

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.

Posted
[21:00:24] [Client thread/ERROR] [FML]: Exception loading model for variant primevalforest:stone#stone=andesite for blockstate "primevalforest:stone[stone=andesite]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model primevalforest:stone#stone=andesite with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:134) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:222) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:144) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:210) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:127) ~[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:120) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:535) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:381) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
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_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:75) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1159) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:130) ~[ModelLoaderRegistry.class:?]
... 21 more

[21:00:35] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant primevalforest:stone#stone=andesite: 
java.lang.Exception: Could not load model definition for variant primevalforest:stone
at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:255) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:120) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:210) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:127) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.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:792) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:332) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:554) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:381) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
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_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_91]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'primevalforest:stone' from: 'primevalforest:blockstates/stone.json' in resourcepack: 'FMLFileResourcePack:Primeval Forest 2'
at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:222) ~[ModelBakery.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:199) ~[ModelBakery.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:184) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:251) ~[ModelLoader.class:?]
... 23 more

Developer of Primeval Forest.

Posted
  On 5/20/2016 at 7:52 PM, tom2208 said:

use my code above, it works

Is there no way to just use the Minecraft model until I've got my own texture done?

For one of my blocks its already working that way, but they have just the default block state and no custom ones which the one which is not working has.

Developer of Primeval Forest.

Posted

Please post the whole log like I asked you to. It looks like you may have cut off part of the error.

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.

Posted

yes, "not that good at pixel art" he said, so you can use the minecraft textures on this way. This is the best way i think or the easiest. And if you do complicated models this will help too.

If you want a complicadet model form minecraft you can use copy and paste.

if you want to put your own texture on it, edit the model json:

{

    "parent": "block/cube_all",

    "textures": {

        "all": "your folder name:blocks/texutrename" //use .png for the texture

    }

}

Posted

 

  Reveal hidden contents

 

 

Here is the full log. As you can see, there are serveral other json files which give an error, just ignore them....

They are from 1.8.9 or are missing because I haven't implemented them yet.... (rather doing a few hundreds lines of Java code then doing one line json code) Just to mention, this is the code which works without blockstates:

{
    "variants": {
        "normal": { "model": "minecraft:sand" }
    }
}

 

This works fine and uses the Minecraft model and texture, but when I'm trying to do this with my blockstates it's not working liked described above in the first post. ;)

So what's wrong that this is working fine without custom blockstates but not with custom blockstates (which are used as metadata like in 1.7--)...

Developer of Primeval Forest.

Posted
  Quote
[23:14:54] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant primevalforest:stone#stone=andesite:

java.lang.Exception: Could not load model definition for variant primevalforest:stone

...

Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'primevalforest:stone' from: 'primevalforest:blockstates/stone.json' in resourcepack: 'FMLFileResourcePack:Primeval Forest 2'

...

Caused by: com.google.gson.JsonSyntaxException: Missing model, expected to find a string

at net.minecraft.util.JsonUtils.getString(JsonUtils.java:105) ~[JsonUtils.class:?]

at net.minecraft.client.renderer.block.model.Variant$Deserializer.getStringModel(Variant.java:130) ~[Variant$Deserializer.class:?]

at net.minecraft.client.renderer.block.model.Variant$Deserializer.deserialize(Variant.java:93) ~[Variant$Deserializer.class:?]

at net.minecraft.client.renderer.block.model.Variant$Deserializer.deserialize(Variant.java:87) ~[Variant$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.VariantList$Deserializer.deserialize(VariantList.java:74) ~[VariantList$Deserializer.class:?]

at net.minecraft.client.renderer.block.model.VariantList$Deserializer.deserialize(VariantList.java:51) ~[VariantList$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.ModelBlockDefinition$Deserializer.parseMapVariants(ModelBlockDefinition.java:161) ~[ModelBlockDefinition$Deserializer.class:?]

at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:138) ~[ModelBlockDefinition$Deserializer.class:?]

at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:132) ~[ModelBlockDefinition$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.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:86) ~[blockStateLoader.class:?]

at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:34) ~[ModelBlockDefinition.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:218) ~[ModelBakery.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:199) ~[ModelBakery.class:?]

at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:184) ~[ModelBakery.class:?]

at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:251) ~[ModelLoader.class:?]

... 23 more

 

Your blockstates file was loaded by the vanilla blockstates loader rather than the Forge one, which threw an exception because your file isn't a valid vanilla blockstates file. Forge only uses the vanilla loader when the file doesn't have the

"forge_marker"

field set to 1. Are you sure assets/primevalforest/blockstates/stone.json has this field?

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.

Posted

Oh, yeah, removed this field while testing more xD

But it does not fix the problem to add this line again. Still the same problem.

 

EDIT:

 

  Reveal hidden contents

 

 

Added the line again:

stone.json

{
    "forge_marker": 1,
    "variants": {
        "stone": {
            "andesite": { "model": "minecraft:stone" }
        }
    }
}

Developer of Primeval Forest.

Posted

I can't see any errors for

primevalforest:stone

in that log, but there were 12 suppressed errors that weren't logged. The number of errors logged per domain is controlled by the

forge.verboseMissingModelLoggingCount

system property, the default value is 5. Could you set this to a higher value by adding the

-Dforge.verboseMissingModelLoggingCount=[b]N[/b]

command-line argument to your run configuration and post the new log?

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.

Posted

You probably need to add it the VM options section rather than Program arguments.

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.

Posted

ok, that worked. ;)

 

  Reveal hidden contents

 

Developer of Primeval Forest.

Posted

The only errors I see for

primevalforest:stone

are

MissingVariantException

s, meaning there's no variant with that name in the blockstates file. I don't see any errors for

primevalforest:stone#stone=andesite

, does that variant's model work now?

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.

Posted
  On 5/20/2016 at 10:30 PM, Bektor said:

Ah, yeah. Now it's working. :)

So it seems to be that the

"defaults": {
    },

caused the problem.

Thx.

 

I'm pretty sure the problem was that you didn't specify all of your variants, not that you had an empty

defaults

section.

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.

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.