Partage
  • Partager sur Facebook
  • Partager sur Twitter

problem MDK item texturing

Sujet résolu
23 juillet 2020 à 23:57:11

hi,


I have a problem with my mod becausethe texture of my item is not loaded (I am in 1.10.2) and I have this error


[19:27:30] [Client thread/ERROR]: Exception loading model for variant strongmod:strongium_ingot#inventory for item "strongmod:strongium_ingot", normal location exception:
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model strongmod:item/strongium_ingot with loader VanillaLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:317) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[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:132) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:755) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:520) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:351) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261]
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_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: strongmod:models/item/strongium_ingot.json
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:868) ~[ModelLoader$VanillaLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more
[19:27:30] [Client thread/ERROR]: Exception loading model for variant strongmod:strongium_ingot#inventory for item "strongmod:strongium_ingot", blockstate location exception:
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model strongmod:strongium_ingot#inventory with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:325) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:147) ~[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:132) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:755) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:520) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:351) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261]
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_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261]
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:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 23 more


could you help me please

thx


(code :

Smain:

package org.strong21.strongmod;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.strong21.strongmod.proxy.CommonProxy;
import org.strong21.strongmod.utils.References;

@Mod(modid = References.MODID, name = References.NAME, version = References.VERSION)
public class Smain {

@SidedProxy(clientSide = References.CLIENT_PROXY, serverSide = References.SERVER_PROXY)
public static CommonProxy proxy;
@Mod.Instance(References.MODID)
public static Smain INSTACE;

@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
proxy.preinit();
}

@Mod.EventHandler
public void init(FMLInitializationEvent e) {
proxy.init();
}

}

References:

package org.strong21.strongmod.utils;

public class References {
public static final String MODID = "strongmod";
public static final String NAME = "Strong Mod";
public static final String VERSION = "b0.0.1";

public static final String CLIENT_PROXY = "org.strong21.strongmod.proxy.ClientProxy";
public static final String SERVER_PROXY = "org.strong21.strongmod.proxy.ServerProxy";
}

CommonProxy:

package org.strong21.strongmod.proxy;

import org.strong21.strongmod.utils.ModItems;

public class CommonProxy {
public void preinit() {
new ModItems();
}
public void init() {

}
}


ClientProxy:

package org.strong21.strongmod.proxy;

public class ClientProxy extends CommonProxy {
@Override
public void preinit() {
super.preinit();
}

@Override
public void init() {
super.init();
}
}

ServerProxy:

package org.strong21.strongmod.proxy;

public class ServerProxy extends CommonProxy {
@Override
public void preinit() {
super.preinit();
}

@Override
public void init() {
super.init();
}
}

Moditems:


package org.strong21.strongmod.utils;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ModItems {

public ModItems() {
initItems();
registerItems();
registerRenders();
}

public Item strongium_ingot;

public void initItems() {
strongium_ingot = new Item().setRegistryName("strongium_ingot").setUnlocalizedName("strongium_ingot");
}
public void registerItems() {
registerItem(strongium_ingot);
}
@SideOnly(Side.CLIENT)
public void registerRenders() {
registerRender(strongium_ingot, 0);
}

private void registerRender(Item item, int meta) {
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(new ResourceLocation(References.MODID, item.getUnlocalizedName().substring(5)), "inventory"));
}

private void registerItem(Item item) {
GameRegistry.register(item);
}

}

strongium_ingot.json:


{
"parent": "item/generated",
"textures": {
"layer0": "strongmod:items/strongium_ingot"
}
}

mcmod.info:


[
{
"modid": "strongmod",
"name": "Strong Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": ["Strong21"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]

-
Edité par TidianDelage1 23 juillet 2020 à 23:58:35

  • Partager sur Facebook
  • Partager sur Twitter
24 juillet 2020 à 2:14:05

Bonjour,

Déplacement vers un forum plus approprié

Le sujet est déplacé de la section Langage Java vers la section Let's talk!

Merci de colorer votre code à l'aide du bouton Code

Les forums d'Openclassrooms disposent d'une fonctionnalité permettant de colorer et mettre en forme les codes source afin de les rendre plus lisibles et faciles à manipuler par les intervenants. Pour cela, il faut utiliser le bouton Code de l'éditeur, choisir un des langages proposés et coller votre code dans la zone prévue. Si vous utilisez l'éditeur de messages en mode Markdown, il faut utiliser les balises <pre class="brush: java;">Votre code ici</pre>.

Merci de modifier votre message d'origine en fonction.

Liens conseillés

  • Partager sur Facebook
  • Partager sur Twitter
24 juillet 2020 à 11:45:02

désolé je n'ais fait qu'un bête copier coller sur un autre forum ou j'ai aussi posté ce message

  • Partager sur Facebook
  • Partager sur Twitter