Before I start, I would like to say that I am new to programming in java so I apologize if I get any terminology wrong.
I've been following bedrockminers tutorial for proxies which can be found here: http://bedrockminer.jimdo.com/modding-tutorials/basic-modding/proxies/
I created the CommonProxy class and this is where I have gotten stuck. His code has the FLM initialization events in them but without importing those events.
package com.bedrockminer.tutorial;
public class CommonProxy {
public void preInit(FMLPreInitializationEvent e) {
}
public void init(FMLInitializationEvent e) {
}
public void postInit(FMLPostInitializationEvent e) {
}
}
I found that I cannot go on to the next step without importing the events.
In addition, eclipse does not seem to understand the @SidedProxy annotation.
@SidedProxy(clientSide="com.bedrockminer.tutorial.ClientProxy", serverSide="com.bedrockminer.tutorial.ServerProxy")
public static CommonProxy proxy;
When I add this code to the main class, @sidedproxy invokes a "cannot be resolved to a type" error.
I realize, in hindsight, i'm probably in way over my head at this point. My knowledge of Java is incredibly rudimentary. Still, I would like to work towards an understanding of what I am doing wrong.
Here is my code for the Main.java, ClientProxy.java, ServerProxy.java, and CommonProxy.java classes. The name of the package differ from his code and mine.
Main.java
package com.ravingmadlunatic.birds;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION)
public class Main {
public static final String MODID = "birds";
public static final String MODNAME = "Realistic Bird Mod";
public static final String VERSION = "1.0.0";
@Instance
public static Main instance = new Main();
/**
* Run before anything else. Read your config, create blocks, items, etc, and
* register them with the GameRegistry.
*/
@SidedProxy(clientSide="com.ravingmadlunatic.birds.CombinedClientProxy", serverSide="com.ravingmadlunatic.birds.DedicatedServerProxy")
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
this.proxy.preInit(e);
}
/**
* Do your mod setup. Build whatever data structures you care about. Register recipes.
*/
@EventHandler
public void init(FMLInitializationEvent e) {
this.proxy.init(e);
}
/**
* Handle interaction with other mods, complete your setup based on this.
*/
@EventHandler
public void postInit(FMLPostInitializationEvent e) {
this.proxy.postInit(e);
}
}
CommonProxy.java
package com.ravingmadlunatic.birds;
public class CommonProxy {
public void preInit(FMLPreInitializationEvent e) {
}
public void init(FMLInitializationEvent e) {
}
public void postInit(FMLPostInitializationEvent e) {
}
}
ServerProxy.java
package com.ravingmadlunatic.birds;
public class ServerProxy extends CommonProxy {
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#preInit(cpw.mods.fml.common.event.FMLPreInitializationEvent)
*/
@Override
public void preInit(FMLPreInitializationEvent e) {
// TODO Auto-generated method stub
super.preInit(e);
}
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#init(cpw.mods.fml.common.event.FMLInitializationEvent)
*/
@Override
public void init(FMLInitializationEvent e) {
// TODO Auto-generated method stub
super.init(e);
}
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#postInit(cpw.mods.fml.common.event.FMLPostInitializationEvent)
*/
@Override
public void postInit(FMLPostInitializationEvent e) {
// TODO Auto-generated method stub
super.postInit(e);
}
ClientProxy.java
package com.ravingmadlunatic.birds;
public class ClientProxy extends CommonProxy {
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#preInit(cpw.mods.fml.common.event.FMLPreInitializationEvent)
*/
@Override
public void preInit(FMLPreInitializationEvent e) {
// TODO Auto-generated method stub
super.preInit(e);
}
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#init(cpw.mods.fml.common.event.FMLInitializationEvent)
*/
@Override
public void init(FMLInitializationEvent e) {
// TODO Auto-generated method stub
super.init(e);
}
/* (non-Javadoc)
* @see com.ravingmadlunatic.birds.CommonProxy#postInit(cpw.mods.fml.common.event.FMLPostInitializationEvent)
*/
@Override
public void postInit(FMLPostInitializationEvent e) {
// TODO Auto-generated method stub
super.postInit(e);
}
}