Jump to content

ravingmadlunatic

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by ravingmadlunatic

  1. 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); } }
  2. @jabelar Thanks you for the advice! I'm looking into ordering the book now! @everyone In hindsight, I know my question was a little bit superfluous. I figure anyone with enough motivation can learn to do anything. But having the idea reinforced by other people is very helpful in the motivation department. Anyway, i'm actually really excited about my prospect now. After going through part of the tutorial, I took a break, watched a movie, and kind of wound down for the evening. Then, after going to bed, I suddenly woke up in the middle of the night realizing something. I was going through the learnaroo tutorial feeling a little frustrated because not all the coding examples I was solving would actually compile in Bluej. For example, x == 28; as a line of code to check if x==28 was not enough alone to get the results as a line of feedback in the console. It was after reading the If and Else part of the tutorial that I stopped. And when I woke up in the middle of the night, I suddenly realized that I could APPLY the If and Else code to check if x == 28 and the println code I learned from Hello World (something I also looked up because I remembered from high school that it's everyone's first program) to print to the results to the console. I know it's really a small step but i'm super proud of myself and i'm going to go write the program now.
  3. I'm going through the tutorial Anon10W1z recommended at the moment. I remember the first program I ever made by myself was a pretty satisfying experience. I have about 6 months before i'm able to go back to college so I figure i'll give learning Java a shot. Thanks for all the advice from everyone!
  4. Sorry if this is the wrong forum for this. So I've been attempting to learn how to mod for the last 4 days. I've managed to set up a development environment for modding but I've gotten pretty stuck when it comes to the coding tutorials. I've decided to go ahead and read up on programming since I obviously have no idea what I am doing. Then, after reading the introduction to an online PDF book on Java, it occurred to me: is this even possible for me? So I made a list of my prospects: Pros: -I learned a little bit of Java in high school and I was able to create a very basic text-based program on my own. -I have a lot of time to kill. -IQ of 128. -I'm somewhat persistent when I really want something and right now I really want to make a mod filled with pretty birds. Cons: -When I tried learning programming before, I struggled with it. -I'm mathematically challenged. I barely passed the high school based mathematical prerequisites for college. I had to repeat all of my community college algebra classes at least once. -My highest level of mathematics was a college-level statistics class. I took it 3 years ago. If I have no chance, I want to know before I waste all my time trying.
×
×
  • Create New...

Important Information

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