Proxies
The next thing you will have to do is set up your mod's proxies. First of all, you should have 2 custom packages:
1. mymod.common
2. mymod.client
Your main file should be in mymod.common, if not move it there. Once that's accounted for, make a new class: CommonProxy and put it inside mymod.common. Also make another new class: ClientProxy and put it inside mymod.client.
Next is the code, copy and paste it into your respective classes. There actually isn't much to explain about these so it's pretty straightforward.
Common Proxy Class:
package mymod.common;
public class CommonProxy
{
public void registerRenderThings()
{
}
}
Client Proxy Class:
package mymod.client;
import mymod.common.*;
public class ClientProxy
{
//Overrides the method from CommonProxy.
@Override
public void registerRenderThings()
{
}
}
Once you have added that code, go back into your Core file and add the pieces of code that are red to your class:
Core Class:
package mymod.common;
import net.minecraft.src.*;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
//This is just another import to make the method below work.
import cpw.mods.fml.common.SidedProxy;
@Mod(modid = "ID of Your Mod", name = "Name of Your Mod", version = "Version of Your Mod")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class CoreModFileName
{
//This makes your proxy work.
@SidedProxy(clientSide = "mymod.client.ClientProxy", serverSide = "mymod.common.CommonProxy")
public static CommonProxy proxy;
@Init
public void Init(FMLInitializationEvent event)
{
//Remember this method from CommonProxy?
proxy.registerRenderThings();
}
}
1. mymod.common
2. mymod.client
Your main file should be in mymod.common, if not move it there. Once that's accounted for, make a new class: CommonProxy and put it inside mymod.common. Also make another new class: ClientProxy and put it inside mymod.client.
Next is the code, copy and paste it into your respective classes. There actually isn't much to explain about these so it's pretty straightforward.
Common Proxy Class:
package mymod.common;
public class CommonProxy
{
public void registerRenderThings()
{
}
}
Client Proxy Class:
package mymod.client;
import mymod.common.*;
public class ClientProxy
{
//Overrides the method from CommonProxy.
@Override
public void registerRenderThings()
{
}
}
Once you have added that code, go back into your Core file and add the pieces of code that are red to your class:
Core Class:
package mymod.common;
import net.minecraft.src.*;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
//This is just another import to make the method below work.
import cpw.mods.fml.common.SidedProxy;
@Mod(modid = "ID of Your Mod", name = "Name of Your Mod", version = "Version of Your Mod")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class CoreModFileName
{
//This makes your proxy work.
@SidedProxy(clientSide = "mymod.client.ClientProxy", serverSide = "mymod.common.CommonProxy")
public static CommonProxy proxy;
@Init
public void Init(FMLInitializationEvent event)
{
//Remember this method from CommonProxy?
proxy.registerRenderThings();
}
}