Résolu Problème block variants
-
Bonjour,
Je suis actuellement en train de créé un bloc de marbre sous différentes formes pour l’utiliser dans les structures que je génère mais je ne sais pas pourquoi tous est correct sauf que les models ne se charge pas et le message dans la console m’indique que les variants du blockstate n’ont pas été trouver.
blockstate:
{ "variants": { "marble_type=raw": "starsorcery:marble/marble_raw", "marble_type=bricks": "starsorcery:marble/marble_bricks", "marble_type=pillar": "starsorcery:marble/marble_pillar", "marble_type=arch": "starsorcery:marble/marble_arch", "marble_type=chiseled": "starsorcery:marble/marble_chiseled", "marble_type=engraved": "starsorcery:marble/marble_engraved", "marble_type=runed": "starsorcery:marble/marble_runed", "marble_type=pillar_top": "starsorcery:marble/marble_pillar_top", "marble_type=pillar_bottom": "starsorcery:marble/marble_pillar_bottom" } }
message d’erreur:
[13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=engraved for blockstate "starsorcery:marble[marble_type=engraved]" and for item "starsorcery:marble", normal location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:item/marble with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.io.FileNotFoundException: starsorcery:models/item/marble.json at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:73) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=engraved for blockstate "starsorcery:marble[marble_type=engraved]" and for item "starsorcery:marble", blockstate location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:marble#marble_type=engraved with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant starsorcery:marble#marble_type=engraved: java.lang.Exception: Could not load model definition for variant starsorcery:marble at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:269) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'starsorcery:marble' from: 'starsorcery:blockstates/marble.json' in resourcepack: 'FMLFileResourcePack:Star Sorcery' at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:246) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?] ... 20 more Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Not a JSON Object: "starsorcery:marble/marble_raw" at com.google.gson.Gson.fromJson(Gson.java:899) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:952) ~[Gson.class:?] at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[TreeTypeAdapter$GsonContextImpl.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.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:952) ~[Gson.class:?] at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[TreeTypeAdapter$GsonContextImpl.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.parseMapVariants(ModelBlockDefinition.java:169) ~[ModelBlockDefinition$Deserializer.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:146) ~[ModelBlockDefinition$Deserializer.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:140) ~[ModelBlockDefinition$Deserializer.class:?] at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:825) ~[Gson.class:?] at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:107) ~[BlockStateLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:42) ~[ModelBlockDefinition.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:242) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?] ... 20 more Caused by: java.lang.IllegalStateException: Not a JSON Object: "starsorcery:marble/marble_raw" at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:90) ~[JsonElement.class:?] at net.minecraft.client.renderer.block.model.Variant$Deserializer.deserialize(Variant.java:92) ~[Variant$Deserializer.class:?] at net.minecraft.client.renderer.block.model.Variant$Deserializer.deserialize(Variant.java:87) ~[Variant$Deserializer.class:?] at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:952) ~[Gson.class:?] at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[TreeTypeAdapter$GsonContextImpl.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.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:952) ~[Gson.class:?] at com.google.gson.internal.bind.TreeTypeAdapter$GsonContextImpl.deserialize(TreeTypeAdapter.java:162) ~[TreeTypeAdapter$GsonContextImpl.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.parseMapVariants(ModelBlockDefinition.java:169) ~[ModelBlockDefinition$Deserializer.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:146) ~[ModelBlockDefinition$Deserializer.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition$Deserializer.deserialize(ModelBlockDefinition.java:140) ~[ModelBlockDefinition$Deserializer.class:?] at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69) ~[TreeTypeAdapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:887) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:825) ~[Gson.class:?] at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:107) ~[BlockStateLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:42) ~[ModelBlockDefinition.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:242) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:265) ~[ModelLoader.class:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=pillar_top for blockstate "starsorcery:marble[marble_type=pillar_top]" and for item "starsorcery:marble", normal location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:item/marble with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.io.FileNotFoundException: starsorcery:models/item/marble.json at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:73) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=pillar_top for blockstate "starsorcery:marble[marble_type=pillar_top]" and for item "starsorcery:marble", blockstate location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:marble#marble_type=pillar_top with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=bricks for blockstate "starsorcery:marble[marble_type=bricks]" and for item "starsorcery:marble", normal location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:item/marble with loader VanillaLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:302) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] Caused by: java.io.FileNotFoundException: starsorcery:models/item/marble.json at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:73) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:65) ~[SimpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:334) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.access$1400(ModelLoader.java:115) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:861) ~[ModelLoader$VanillaLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:157) ~[ModelLoaderRegistry.class:?] ... 20 more [13:56:59] [Client thread/ERROR] [FML]: Exception loading model for variant starsorcery:marble#marble_type=bricks for blockstate "starsorcery:marble[marble_type=bricks]" and for item "starsorcery:marble", blockstate location exception: net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model starsorcery:marble#marble_type=bricks with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:296) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:175) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:151) ~[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:132) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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_271] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271] 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:?] ... 20 more [13:56:59] [Client thread/FATAL] [FML]: Suppressed additional 5 model loading errors for domain starsorcery
voici la classe du block:
public class BlockMarble extends BlockVariant<MarbleBlockType> { public static final PropertyEnum<MarbleBlockType> MARBLE_TYPE = PropertyEnum.create("marble_type", MarbleBlockType.class); public BlockMarble() { super("marble", Material.ROCK, MapColor.GRAY, MarbleBlockType.values()); setHardness(1F); setHarvestLevel(Tools.PICKAXE.getId(), 1); setResistance(3F); setSoundType(SoundType.STONE); setDefaultState(this.getBlockState().getBaseState().withProperty(MARBLE_TYPE, MarbleBlockType.RAW)); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { if(state.getValue(MARBLE_TYPE).isPillar()) { IBlockState st = worldIn.getBlockState(pos.up()); boolean top = false; if(st.getBlock() instanceof BlockMarble && st.getValue(MARBLE_TYPE).isPillar()) { top = true; } st = worldIn.getBlockState(pos.down()); boolean down = false; if(st.getBlock() instanceof BlockMarble && st.getValue(MARBLE_TYPE).isPillar()) { down = true; } if(top && down) { return state.withProperty(MARBLE_TYPE, MarbleBlockType.PILLAR); } else if(top) { return state.withProperty(MARBLE_TYPE, MarbleBlockType.PILLAR_BOTTOM); } else if(down) { return state.withProperty(MARBLE_TYPE, MarbleBlockType.PILLAR_TOP); } else { return state.withProperty(MARBLE_TYPE, MarbleBlockType.PILLAR); } } return super.getActualState(state, worldIn, pos); } @Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) { return state.getValue(MARBLE_TYPE).isPillar() ? BlockFaceShape.UNDEFINED : BlockFaceShape.SOLID; } @Override public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos) { MarbleBlockType marbleType = state.getValue(MARBLE_TYPE); if(marbleType.isPillar()) return 0; return super.getLightOpacity(state, world, pos); } @Override public boolean isOpaqueCube(IBlockState state) { MarbleBlockType marbleType = state.getValue(MARBLE_TYPE); return !marbleType.isPillar(); } @Override public boolean isFullCube(IBlockState state) { MarbleBlockType marbleType = state.getValue(MARBLE_TYPE); return !marbleType.isPillar(); } @Override public boolean isFullBlock(IBlockState state) { MarbleBlockType marbleType = state.getValue(MARBLE_TYPE); return !marbleType.isPillar(); } @Override public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) { MarbleBlockType marbleType = state.getValue(MARBLE_TYPE); IBlockState other = world.getBlockState(pos.offset(face)); if(MiscUtils.isFluidBlock(other) && (marbleType == MarbleBlockType.PILLAR || marbleType == MarbleBlockType.PILLAR_BOTTOM || marbleType == MarbleBlockType.PILLAR_TOP)) { return false; } if(marbleType == MarbleBlockType.PILLAR_TOP) { return face == EnumFacing.UP; } if(marbleType == MarbleBlockType.PILLAR_BOTTOM) { return face == EnumFacing.DOWN; } return state.isOpaqueCube(); } @Override public boolean isTopSolid(IBlockState state) { return true; } @Override public int getMetaFromState(IBlockState state) { return state.getValue(MARBLE_TYPE).getMetadata(); } @Override public ItemBlockVariant getItemBlock() { return ItemsStarSorcery.INSTANCE.marble; } @Override public IBlockState getStateFromMeta(int meta) { return meta < MarbleBlockType.values().length ? getDefaultState().withProperty(MARBLE_TYPE, MarbleBlockType.values()[meta]) : getDefaultState(); } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, MARBLE_TYPE); }
voici block variant:
public abstract class BlockVariant<VAR extends IEnumVariant> extends BlockBase { private final VAR[] META_LOOKUP; public BlockVariant(String name, Material material, VAR[] META_LOOKUP) { this(name, material, material.getMaterialMapColor(), META_LOOKUP); } public BlockVariant(String name, Material material, MapColor mapColor, VAR[] META_LOOKUP) { super(name, material, mapColor); this.META_LOOKUP = META_LOOKUP; } @Override public void getSubBlocks(CreativeTabs itemIn, NonNullList<ItemStack> items) { for (VAR value : META_LOOKUP) if (value.obtainableInCreative()) items.add(value.toItemStack()); } public abstract ItemBlockVariant getItemBlock(); public VAR[] getMETA_LOOKUP() { return META_LOOKUP; } @Override public abstract int getMetaFromState(IBlockState state); @Override public abstract IBlockState getStateFromMeta(int meta); @Override protected abstract BlockStateContainer createBlockState(); @Override public int damageDropped(IBlockState state) { return getMetaFromState(state); } }
et pour finir l’enregistrement des models :
@SubscribeEvent public void registerBlocksModel(ModelRegistryEvent event) { for(BlockBase block : blocks) { if(block instanceof BlockVariant) registerBlockVariantModels((BlockVariant) block, ((BlockVariant)block).getMETA_LOOKUP()); else registerBlockModel(block); } } private void registerBlockVariantModels(final BlockVariant block, IEnumVariant[] META_LOOKUP) { for(IEnumVariant value : META_LOOKUP) { System.out.println("VALUE : " + value.getVar()); ModelLoader.setCustomModelResourceLocation(block.getItemBlock(), value.getMetadata(), new ModelResourceLocation(block.getRegistryName(), value.getVar())); } }
si je peut vous fournir autre chose dites le moi :beaming_face_with_smiling_eyes:
Merci
-
Bonsoir,
Tes variants n’ont pas la bonne syntaxe, cela devrait être :
“marble_type=raw”: {“model”: “starsorcery:marble/marble_raw” },
-
Bonsoir,
Tes variants n’ont pas la bonne syntaxe, cela devrait être :
“marble_type=raw”: {“model”: “starsorcery:marble/marble_raw” },
-
Ouin Merci je m’excuse du dérangement car j’ai résolu le problème tout seul finalement.
Merci encore
-