Jump to content

Base mod for 1.8


browndunce

Recommended Posts

Sorry about this nub question, I am aware that you guys probably get this question at least once a week. I have a basic knowledge of Java, but not of modding Minecraft, so this is very foreign to me as of right now.

 

The Basic Modding tutorial (http://www.minecraftforge.net/wiki/Basic_Modding) is a bit outdated for 1.8. The base mod for 1.8 is located in the page source, but it is not very helpful This is what it says verbatim.

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler; // used in 1.6.2
//import cpw.mods.fml.common.Mod.PreInit;    // used in 1.5.2
//import cpw.mods.fml.common.Mod.Init;       // used in 1.5.2
//import cpw.mods.fml.common.Mod.PostInit;   // used in 1.5.2
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
//import cpw.mods.fml.common.network.NetworkMod; // not used in 1.7

@Mod(modid="GenericModID", name="Generic", version="0.0.0")
//@NetworkMod(clientSideRequired=true) // not used in 1.7
public class Generic {

        // The instance of your mod that Forge uses.
@Instance(value = "GenericModID")
public static Generic instance;

// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="tutorial.generic.client.ClientProxy", serverSide="tutorial.generic.CommonProxy")
public static CommonProxy proxy;

@EventHandler // used in 1.6.2
//@PreInit    // used in 1.5.2
public void preInit(FMLPreInitializationEvent event) {
	// Stub Method
}

@EventHandler // used in 1.6.2
//@Init       // used in 1.5.2
public void load(FMLInitializationEvent event) {
	proxy.registerRenderers();
}

@EventHandler // used in 1.6.2
//@PostInit   // used in 1.5.2
public void postInit(FMLPostInitializationEvent event) {
	// Stub Method
}

If you copy this verbatim, but don't have the proxy classes, it may be possible for the mod to work for single player, but not for multiplayer. As such, make sure the proxy classes are created as described in the next section.

 

That's a lot of imports and annotations, no? The import list will only get longer with each additional tutorial you follow. Generally, Eclipse will handle imports for you, so I will not explicitly say to add import statements.

 

There '''WILL''' be an error when you copy this code. CommonProxy should be underlined red. This is because it will be created in the [[#Proxy Classes|Proxy Classes]] section.

 

Now that we've got that out of the way, you'll notice that there are a lot of @annotations and import statements (which will only get longer as you continue to mod and add more content to your mod); This is the absolute basis for creating a Mod for 1.8, But it won't do anything (at least, not yet).

 

However, I can not find this proxy section that it is talking about. Can you guys explain to me what this "proxy section" is and how I should implement it to have a base mod for 1.8?

 

P.S. What is Lex's full name? I can only find "Lex Manos", and that doesn't work for verification

Link to comment
Share on other sites

http://www.minecraftforge.net/forum/index.php?action=profile;u=5

 

And don't bug him unless you have to. He does not maintain the content of the wiki pages, so there's no point in complaining directly to him, he will tell you "it is a wiki, if the information is wrong or missing, fix it."

 

The page says to "view the page source to see a1.8 proxy" just above the section you quoted.

I don't know why the "Proxy Classes" section is commented out, but you can view it if you click on one of the edit buttons.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

https://github.com/TheGreyGhost/MinecraftByExample

 

If you are asking "what is proxy?" - think of it as a way to reference things that are not there.

Some of fields/methods/classes are marked with SideOnly - that means thay will be loaded only by given side (Client.jar or Dedicated.jar). On other side they will be not loaded to VM which will result in NoClassDefFound when trying to access them with common code. That's why there are proxies - proxy will be setup for given side and can safely call SideOnly methods. All calls should be redirected there.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

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.