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    7697

diesieben07

diesieben07    7697

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7697
  • 56430 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
      java.lang.ExeptionInInitializerError: null

      By diesieben07 · Posted just now

      Show your code.
    • heavengel
      error minecraft this server has mod that requires forge to be installed on client

      By heavengel · Posted 6 minutes ago

      Hello   When I try to get in the server there's this message appearing : error minecraft this server has mod that requires forge to be installed on client But it happens that there is NO mod installed on the server, how is this message appearing then ?  Can someone help me please
    • diesieben07
      Can't launch Forge because of spongepowered.[...].MixinTweaker

      By diesieben07 · Posted 37 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • NullDev
      Text Color Formatting

      By NullDev · Posted 37 minutes ago

      I've done that like this, but now it just appears all black   IFormattableTextComponent toSend = new StringTextComponent("Info: "); toSend.func_240701_a_(TextFormatting.WHITE) .func_230529_a_(new StringTextComponent(ticksRemaining/20 + " | ")) .func_240701_a_(TextFormatting.RED) .func_230529_a_(new StringTextComponent(Integer.toString(redstoneAdded))) .func_240701_a_(TextFormatting.WHITE) .func_230529_a_(new StringTextComponent(" | ")) .func_240701_a_(TextFormatting.GREEN) .func_230529_a_(new StringTextComponent(Integer.toString(emeraldAdded))) .func_240701_a_(TextFormatting.WHITE) .func_230529_a_(new StringTextComponent(" | ")) .func_240701_a_(TextFormatting.AQUA) .func_230529_a_(new StringTextComponent(Integer.toString(diamondAdded))) .func_240701_a_(TextFormatting.WHITE) .func_230529_a_(new StringTextComponent(" | ")) .func_240701_a_(TextFormatting.BLACK) .func_230529_a_(new StringTextComponent(Integer.toString(coalAdded))); player.sendStatusMessage(toSend, true);  
    • We Random
      java.lang.ExeptionInInitializerError: null

      By We Random · Posted 48 minutes ago

      I am making a mod right? Im using IntellijIdea but its not an issue with Intellij I dont think... I keep on getting an error when i try to run the client (the pastebin is down below). A little something you should know - This is 1.16.5, it was working earlier until i added blocks, and i am a complete noob.   https://pastebin.com/Ynj862CG     any help is GREATLY appreciated
  • Topics

    • We Random
      1
      java.lang.ExeptionInInitializerError: null

      By We Random
      Started 48 minutes ago

    • heavengel
      0
      error minecraft this server has mod that requires forge to be installed on client

      By heavengel
      Started 6 minutes ago

    • Leetram_519
      1
      Can't launch Forge because of spongepowered.[...].MixinTweaker

      By Leetram_519
      Started 52 minutes ago

    • NullDev
      2
      Text Color Formatting

      By NullDev
      Started 2 hours ago

    • jonaskohl
      4
      [Solved] Registering custom flowers as compostable

      By jonaskohl
      Started Yesterday at 04:47 PM

  • Who's Online (See full list)

    • heavengel
    • diesieben07
    • Miguelowwski
    • Herobrine510
    • samuelderam
    • Tavi007
    • loordgek
    • CoreOfLife
    • Bspeaker
    • PJcactus
    • Alexdakid09
    • trs_sousa
  • 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