Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12] Build path issues/Assets folder not being loaded


naturaGodhead
 Share

Recommended Posts

I'm working on a small mod for a modpack, and having issues getting the assets to load. I've never really had this issue before, so I'm not sure what's going on. The textures, models, and lang files are not being loaded, so I know its affecting the entire assets folder. My file structure is this:

 

https://imgur.com/XO2YfBI

 

I've checked to make sure the modid is "survivalgear". All my code for loading models is the same as other mods I've written. I was getting a "FileNotFoundException" for my item's model in the console, but its no longer showing me that when I restart after I tried setupDecompWorkspace again.

 

SurvivalGear.java

Spoiler

package com.natura.survivalgear;

import com.natura.survivalgear.block.ModBlocks;
import com.natura.survivalgear.item.ModItems;
import com.natura.survivalgear.proxy.CommonProxy;

import net.minecraftforge.common.MinecraftForge;
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;

@Mod(modid = SurvivalGear.MODID, name = SurvivalGear.MODNAME, version = SurvivalGear.VERSION, useMetadata = true, acceptedMinecraftVersions = "[1.12,1.12.2]")
public class SurvivalGear {

	public static final String MODID = "survivalgear";
    public static final String MODNAME = "Survival Gear";
    public static final String VERSION = "1.0.0";
    
    @SidedProxy(clientSide = "com.natura.survivalgear.proxy.ClientProxy", serverSide = "com.natura.survivalgear.proxy.CommonProxy")
    public static CommonProxy proxy;

    @Mod.Instance(MODID)
    public static SurvivalGear instance;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    	
    	MinecraftForge.EVENT_BUS.register(ModBlocks.class);
    	MinecraftForge.EVENT_BUS.register(ModItems.class);
    	
    	proxy.preInit();
    	
    }
    
    @EventHandler
    public void init(FMLInitializationEvent e) {
    	
    	proxy.init();
    	
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent e) {
    	
    	proxy.postInit();
    	
    }
    
}

 

 

ModelHandler.java

Spoiler

package com.natura.survivalgear.client;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import static com.natura.survivalgear.item.ModItems.*;

@SideOnly(Side.CLIENT)	
public class ModelManager {

	@SubscribeEvent
	public static void handleModelRegistry(ModelRegistryEvent event)
	{
		
		itemModels();
		blockModels();
		
	}
	
	private static void itemModels()
	{
		register(fireStarter);
	}
	
	private static void blockModels()
	{
		
	}
	
	private static void register(Item item)
	{
		
		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Item.REGISTRY.getNameForObject(item), "inventory"));
	
	}
	
	private static void register(Block block)
	{
		
		register(Item.getItemFromBlock(block));
		
	}
}

 

 

The one line from my en_US.lang: item.fireStarter.name=Survivalist's Fire Starter

 

EDIT: Build path here https://imgur.com/U8F1OoN

 

Edited by naturaGodhead
Link to comment
Share on other sites

[12:56:20] [Client thread/ERROR] [FML]: Exception loading model for variant survivalgear:fire_starter#inventory for item "survivalgear:fire_starter", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model survivalgear:item/fire_starter 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: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_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_171]
	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_171]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_171]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:25) [start/:?]
Caused by: java.io.FileNotFoundException: survivalgear:models/item/fire_starter.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:?]

 

Link to comment
Share on other sites

46 minutes ago, naturaGodhead said:

Item.REGISTRY.getNameForObject(item)

Why not item.getRegistryName()?

42 minutes ago, naturaGodhead said:

survivalgear:models/item/fire_starter.json

Is this where the file is located look at it character by character. 

 

47 minutes ago, naturaGodhead said:

The one line from my en_US.lang: item.fireStarter.name=Survivalist's Fire Starter

You've got a pack.mcmeta file probably set to 3. This means your lang files must be all lowercase aka en_us.lang.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

20 minutes ago, Animefan8888 said:

Why not item.getRegistryName()?

Shrug. Just the way I learned it by example. Will it break anything doing it the way I have? Or is it just inconvenience?

 

20 minutes ago, Animefan8888 said:

Is this where the file is located look at it character by character.  

https://imgur.com/BzGF6GH

 

It looks like it to me, but maybe I'm not looking hard enough. I have issues reading strings of letters/number sometimes.

20 minutes ago, Animefan8888 said:

You've got a pack.mcmeta file probably set to 3. This means your lang files must be all lowercase aka en_us.lang.

Thanks for the heads up, but that didn't fix anything. Still no localization in the game. I double checked the unlocalized and registry names as well.

Edited by naturaGodhead
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.