Jump to content

Recommended Posts

Posted

BitofTuts.java

package Fatal1tyGC.BitofTuts;

import Fatal1tyGC.BitofTuts.init.ModItems;
import Fatal1tyGC.BitofTuts.proxy.CommonProxy;
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 = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)

public class BitofTuts {

@SidedProxy(serverSide = Reference.SERVER_PROXY_CLASS, clientSide = Reference.CLIENT_PROXY_CLASS)
public static CommonProxy proxy;

@Mod.Instance("bot")
public static BitofTuts instance;

@EventHandler()
public static void preInit(FMLPreInitializationEvent event){
	ModItems.init();
	ModItems.register();
}

@EventHandler()	
public static void init(FMLInitializationEvent event){
	//proxy.registerRenders();
}

@EventHandler()
public static void postIn(FMLPostInitializationEvent event){
	System.out.println();
}

}

you noticed that register renders is comment right? xD plz dont tell me that that was it..

Doing stuff n' things

Posted

Its not it haha, i commented it because it didnt do anything, because CommonProxy is empty

 

>

 

package Fatal1tyGC.BitofTuts.proxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;


public class CommonProxy {

public void registerRenders(){

}

public void preInit(FMLPreInitializationEvent event){

    }

    public void init(FMLInitializationEvent event) {

    }


    public void postInit(FMLPostInitializationEvent event) {

    }
}


Posted

	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory"));

 

Sameerrors, all about

 

[21:21:40] [Client thread/ERROR] [FML]: Exception loading model for variant bot:copper_ingot#inventory for item "bot:copper_ingot", blockstate location exception:

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model bot:copper_ingot#inventory with loader VariantLoader.INSTANCE, skipping

Posted

What is this:

ModelLoader.setCustomModelResourceLocation

i never seen it before..

why arent you using:

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register

that's how i made it register renders..

If you don't know what you are doing please don't help people.

ModelLoader is the correct way, the ItemModelMesher is discouraged.

 

Please dont say "dont help people"... To what I knew, that was how to register renders and I was just trying to help while there was no moderator that came in......  To my knowledge, that's what a forum supposed to be... Sometimes people in forums are trying to help while they may not be right 100%....

Doing stuff n' things

Posted

It changed 1 thing, the line break with the } Still doesnt work ;)

 

Error: Parse error on line 5:

..._ingot"    },    }

---------------------^

Expecting 'STRING', got '}'

Posted

It changed 1 thing, the line break with the } Still doesnt work ;)

 

Error: Parse error on line 5:

..._ingot"    },    }

---------------------^

Expecting 'STRING', got '}'

the ',' after textures end..

 

should look like:

{
"parent": "item/generated",
"textures": {
	"layer0": "bot:items/copper_ingot"
}
}

why didnt i see that idk

Doing stuff n' things

Posted

Hmm...

  • Path to texture seems fine
  • json is valid
  • json file name equals registryName
  • You are using ModelLoader

You sure that your proxy is being called at all?

 

So,

 

@EventHandler()	
public static void init(FMLInitializationEvent event){
	proxy.registerRenders();
}

This is being called in the main java,

proxy refers to

public static CommonProxy proxy;

CommonProxy.java

only has this:

 

package Fatal1tyGC.BitofTuts.proxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;


public class CommonProxy {

public void registerRenders(){

}

public void preInit(FMLPreInitializationEvent event){

    }

    public void init(FMLInitializationEvent event) {

    }


    public void postInit(FMLPostInitializationEvent event) {

    }
}

 

Thats all

Posted

Sorry, but ModelLoader.setCustomModelResourceLocation is the Forge-provided method for registering your model for an item/block, and should be initialized in your preInit, not init.

 

thank you.. just did that in my mod, works perfectly!

Doing stuff n' things

Posted

Sorry, but ModelLoader.setCustomModelResourceLocation is the Forge-provided method for registering your model for an item/block, and should be initialized in your preInit, not init.

 

Heheheheheheheh

 

That was it! Thanks :D It works

 

Ya'all are legends,

Thanks for the input everyone on making my start better :D

 

d6693235e4474afebcbb9e9db33c5132.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.