Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Textures not loading, language file not working either
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Leronus

Textures not loading, language file not working either

By Leronus, January 18 in Modder Support

  • Start new topic

Recommended Posts

Leronus    0

Leronus

Leronus    0

  • Tree Puncher
  • Leronus
  • Members
  • 0
  • 6 posts
Posted January 18

Hey guys, I'm new to the forum. I have done some Minecraft modding in the past, specifically on version 1.7.2

I tried to get back into the modding on version 1.12.2 to find that things are (in my opinion) a lot more complicated and difficult. 

I believe I have done all the file naming right but for some reason the language file (en_us.lang) and the texture for my first item (ruby_gem) won't load.

The exception it gives me is that the file is not found. I've tried searching everywhere but can't find out what I did wrong.

I may have some bad practice here and there, feel free to correct me on that. But please do it in the most comprehensive way, because simply reading the Forge documentation has got me all dizzy and confused lol.

I have basic Java understanding, as in, I know the basics of object oriented programming, but I'm still very new to this.

 

ItemInit:

 

package mod.mores.init;

import mod.mores.objects.ItemBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAir;

import java.util.ArrayList;
import java.util.List;

public class ItemInit {
    public static final List<Item> ITEMS = new ArrayList<Item>();

    public static final Item RUBY_GEM = new ItemBase("ruby_gem");
}

 

ItemBase:

package mod.mores.objects;

import mod.mores.init.ItemInit;
import mod.mores.modid.Mores;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class ItemBase extends Item
{
    public ItemBase(String name)
    {
        setRegistryName(name);
        setUnlocalizedName(name);
        setCreativeTab(CreativeTabs.MATERIALS);

        ItemInit.ITEMS.add(this);
    }

    public void registerModels()
    {
        Mores.proxy.registerItemRenderer(this, 0, "inventory");
    }
}

 

Main:

package mod.mores.modid;

import mod.mores.items.swords.RubySword;
import mod.mores.proxy.CommonProxy;
import mod.mores.util.Reference;
import mod.mores.util.handlers.RegistryHandler;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
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.event.FMLServerStartingEvent;


@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Mores
{
    @Mod.Instance
    public static Mores instance;

    @SidedProxy(clientSide = Reference.CLIENT, serverSide = Reference.COMMON)
    public static CommonProxy proxy;


    public static ToolMaterial ruby;


    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        RegistryHandler.preInitRegistries();

    	//ToolMaterials
    	ruby = EnumHelper.addToolMaterial("ruby", 3, 1345, 8.0F, 2.5F, 14);
    }

    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        RegistryHandler.initRegistries();
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
        RegistryHandler.postInitRegistries();
    }

    @EventHandler
    public static void serverInit(FMLServerStartingEvent event)
    {
        RegistryHandler.serverRegistries();
    }
}

 

ClientProxy:

package mod.mores.proxy;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;

public class ClientProxy extends CommonProxy
{
    @Override
    public void registerItemRenderer(Item item, int meta, String id)
    {
        ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    }

    @Override
    public void render()
    {

    }
}

 

CommonProxy:

package mod.mores.proxy;

import net.minecraft.item.Item;

public class CommonProxy
{

	public void registerItemRenderer(Item item, int meta, String id)
	{

	}
	public void render()
	{

	}
}

 

RegistryHandler:

package mod.mores.util.handlers;

import mod.mores.init.BlockInit;
import mod.mores.init.ItemInit;
import mod.mores.modid.Mores;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod.EventBusSubscriber
public class RegistryHandler
{
    @SubscribeEvent
    public static void onItemRegister(RegistryEvent.Register<Item> event)
    {
        event.getRegistry().registerAll(ItemInit.ITEMS.toArray(new Item[0]));
    }

    @SubscribeEvent
    public static void onModelRegister(ModelRegistryEvent event)
    {
        for(Item item : ItemInit.ITEMS)
        {
            Mores.proxy.registerItemRenderer(item, 0, "inventory");
        }
        for(Block block : BlockInit.BLOCKS)
        {
            Mores.proxy.registerItemRenderer(Item.getItemFromBlock(block), 0, "inventory");
        }
    }

    @SubscribeEvent
    public static void onBlockRegister(RegistryEvent.Register<Block> event)
    {
        event.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0]));
    }

    public static void preInitRegistries()
    {
        Mores.proxy.render();
    }

    public static void initRegistries()
    {

    }

    public static void postInitRegistries()
    {

    }

    public static void serverRegistries()
    {

    }
}

 

Loading errors:

 

[20:50:41] [Client thread/ERROR] [FML]: Exception loading model for variant mores:ruby_gem#inventory for item "mores:ruby_gem", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mores:item/ruby_gem 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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	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_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
	at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
Caused by: java.io.FileNotFoundException: mores:models/item/ruby_gem.json
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[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
[20:50:41] [Client thread/ERROR] [FML]: Exception loading model for variant mores:ruby_gem#inventory for item "mores:ruby_gem", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mores:ruby_gem#inventory 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:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:513) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:378) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	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_275]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_275]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at net.minecraftforge.legacydev.Main.start(Main.java:86) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
	at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) [legacydev-0.2.3.1-fatjar.jar:0.2.3.1+4+372be23]
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

 

 

My main is located at mod/src/main/java/mod/mores/modid/mores.java

My language file is located at mod/src/main/resources/assets/mores/lang/en_us.lang

My texture is located at mod/src/main/resources/assets/mores/textures/items/ruby_gem.png

My model JSON is located at mod/src/main/resources/assets/mores/models/item/ruby_gem.json

 

 

Share this post


Link to post
Share on other sites

diesieben07    7690

diesieben07

diesieben07    7690

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7690
  • 56306 posts
Posted January 18

1.12 is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      The game crashed whilst rendering overlay

      By diesieben07 · Posted 5 minutes ago

      In the future please make your own thread instead of posting in an old, unrelated thread.   Delete this file.
    • FactionsFire
      Exit code 0 Sorry for inconvenience

      By FactionsFire · Posted 7 minutes ago

      I am trying to lanuch 1.8.9 forge and i get "An unexpected issue happened and the game has crashed exit sorry for inconvenience exit code 0"" And this has happened for about a week. 
    • Merken
      The game crashed whilst rendering overlay

      By Merken · Posted 11 minutes ago

      The game crashed whilst rendering overlay Error: net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file forge-client.toml of type CLIENT for modid forge Exit Code: -1
    • Merken
      The game crashed whilst rendering overlay

      By Merken · Posted 15 minutes ago

      The game crashed whilst rendering overlay Error: net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file forge-client.toml of type CLIENT for modid forge Exit Code: -1
    • diesieben07
      My game keeps crashing

      By diesieben07 · Posted 1 hour ago

      You do not. In the future please make your own thread instead of posting in some random thread that looks vaguely similar.   Your Optifine version is outdated and not listed as compatible with your version of Forge. Refer to the Optifine downloads page regarding compatibility with Forge.
  • Topics

    • Merken
      2
      The game crashed whilst rendering overlay

      By Merken
      Started 16 minutes ago

    • FactionsFire
      0
      Exit code 0 Sorry for inconvenience

      By FactionsFire
      Started 7 minutes ago

    • seekR4621
      1
      My game keeps crashing

      By seekR4621
      Started 2 hours ago

    • NorthWestWind
      2
      [1.16.x] Stop Held Item blobbing in Hand

      By NorthWestWind
      Started 2 hours ago

    • ehbean
      1
      1.16.x Custom Furnace/Brewing Stand

      By ehbean
      Started 11 hours ago

  • Who's Online (See full list)

    • Luis_ST
    • diesieben07
    • FactionsFire
    • rhinitis
    • Merken
    • BossMoussedu75
    • JackRaidenPH
    • brandon3055
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Textures not loading, language file not working either
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community