Jump to content

Recommended Posts

Posted

Ive been trying to learn how to make a simple mod on my own but ive been running into a few problems along the way, I was woundering if anyone would be willing to take some time to do a skype call with me and teach me or help me out.

Posted

sO9jSXI

 

Tutorial.java

package com.meep.tutorial;

import com.meep.tutorial.init.Items;
import com.meep.tutorial.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.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
public class Tutorial {

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

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

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

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{

}
}

 

Reference.java

package com.meep.tutorial;

public class Reference {
public static final String MOD_ID = "MTM";
public static final String MOD_NAME = "Meeps Test Mod";
public static final String VERSION = "0.0.1";
public static final String CLIENT_PROXY_CLASS = "com.meep.tutorial.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "com.meep.tutorial.proxy.CommonProxy";
}

 

Items.java

 

package com.meep.tutorial.init;

import com.meep.tutorial.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class Items {

public static Item test;

public static void init() {
	test = new Item().setUnlocalizedName("test");
}

public static void register()
{
	GameRegistry.registerItem(test, test.getUnlocalizedName().substring(5));
}

public static void registerRenders()
{
	registerRender(test);
}

public static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}

 

clientproxy.java

package com.meep.tutorial.proxy;

import com.meep.tutorial.init.Items;

public class ClientProxy extends CommonProxy{
@Override
public void registerRenders() {
	Items.registerRenders();
}
}

 

commonproxy.java

package com.meep.tutorial.proxy;

public class CommonProxy {
public void registerRenders() {

}
}

 

test.json

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "MTM:items/test"
    },
    "display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }
}

Posted
  On 5/15/2016 at 6:28 PM, Kuuu said:

Make sure your folder with textures has lower case letters. Your modid is 'MTM', folder in assets should be called 'mtm'.

Thank you so much, what is the reason for it being lower cased?

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.