Jump to content

1.3 Migration Confusion! (or, Why We're In For A Wait)


jakj

Recommended Posts

Since Forge has now released a "featured" build of its 1.3.2 branch on Jenkins, I thought I'd go ahead and start looking at it, because continuing to work on 1.2.5 modding is fine for 1.2.5, but so much infrastructure has changed that every moment spent learning it (for someone like me) will be another spent unlearning it when switching to 1.3.2.

Summary: Sweet blessed Agnira on a polka-dotted mule...

So far, from tutorials all across the 'net, I'm swimming in a chunky mixture of pre-Modloader, ModLoaderMP, pre-1.3 Forge, and post-1.3 Forge, and I can make neither heads nor tails out of it. Forge, in particular, gave itself a root canal: ModLoader support now is legacy-only, and the actual FML isn't even in net.minecraft.src and uses compiler annotations and an event bus instead of overrides and hooks.

My current plan is to just abandon the tutorials and start grokking the Forge sources. In the mean time, if anybody can provide a sort of vague outline of the old information, like "X and Y are useful, but U and V will just confuse you, so ignore those parts", that would be rather helpful.

At least it's something to do while GW2 is down. ;-)

Link to comment
Share on other sites

Ok, progress is being made, though it's like trying to swim through molasses, seems like. Everything appears to be similar to how it used to be, but changed so as to be completely unintuitive. There's a page on the forge wiki that I'm finding helpful. http://www.minecraftforge.net/wiki/Tutorials/Upgrading_To_Forge_for_1.3.1

It should be much the same for 1.3.2. So far the most confusing bit is the sided proxy. I have the feeling it could be really powerful, but I'm having trouble wrapping my head around it.

Anyway, I've got the glass and panes working. Haven't started on the furnace yet, but into the breach we go friends.

Link to comment
Share on other sites

What's begun is soonest done. Also, check this out:

https://docs.google.com/document/d/1U1pgNbn0HIM8JY5fe1EV6Zxv20Hlo6UxkHeIU7NIMog/edit?pli=1

It's a godsend for the basic outline. What I gather about Sided Proxy:

  • Create a class ClientProxy (or whatever) that does stuff only the client should do (like register renderers, preload textures, check for client-side-only config options).
  • Create a class CommonProxy that ClientProxy extends, that has the same methods, that are just shells that do nothing.
  • Use the SidedProxy annotation to tell Forge which one is which.

It then instantiates the right one depending on which side your code is being run on, since you can't just distribute a server and client file anymore and they have to be one single file.

Link to comment
Share on other sites

Ah, that does make things slightly clearer.

Xylord, go for it. Now that they've done THE GREAT CODE REDESIGN IN THE SKY, things should be stable for a while. Even when they introduce the official modding API, creating you own block class will stay the same. And of course, there's the possibility that the API won't be that nice and everyone will keep using forge anyway. :P

Link to comment
Share on other sites

Newest build of Forge included this little gem:

Add in a convenience method for getting a class instance based on existence of another Mod. Useful for soft dependencies.

Despite the headaches, I'm starting to get a little excited about Forge's newly-accelerated direction. You know, excited...down there.

Link to comment
Share on other sites

There's a guide to decompiling other mods around here somewhere, if you need it, so you can get de-obfuscated code. Should still be valid for MCP 7.2.

I assume so. My approach was mainly out of laziness in finding and setting it up :)

EDIT - And for anyone else that stumbles upon it, the thread jakj was talking about is here http://www.technicpack.net/forums/threads/how-to-decompile-a-mod-to-see-how-it-works.7602/

Link to comment
Share on other sites

I'm not disputing their power, but their use has a few gotchas that make them pretty annoying to use, especially if you're working in eclipse. For example, lets say you got a method signature wrong. In the old FML, this would have been a compile time error, and eclipse would have kindly pointed this out to you. Now it's a runtime error, for that's when the annotation is evaluated. Additionally, there's no easy way to check what the signature should be like you could if it was overriding a hook. There's no good way to tell anything at all about what the annotation expects, in fact, until it pukes stack all over the console.

Edit: and as ever, there doesn't seem to be any documentation.

Link to comment
Share on other sites

Ah, well, I'm used to using nothing but a plain VIm text-editor and reading the source directly for info, so I don't have to go back and forth across all those layers. To me, the loss of ease most of the time is worth the loss of the gotchas too. (Plus, considering that I'm the sort of anal personality that can become obsessed with making sure there are no extra spaces at the ends of lines, having anything other than a Un*x-y text-editor that doesn't try to "help" might actually drive me nuts.)

Link to comment
Share on other sites

Ah, well, I'm used to using nothing but a plain VIm text-editor and reading the source directly for info, so I don't have to go back and forth across all those layers. To me, the loss of ease most of the time is worth the loss of the gotchas too. (Plus, considering that I'm the sort of anal personality that can become obsessed with making sure there are no extra spaces at the ends of lines, having anything other than a Un*x-y text-editor that doesn't try to "help" might actually drive me nuts.)

I'm really trying to see this as a typo, but I can't see what you could have meant that looks like "anal"...

Link to comment
Share on other sites

If they had half a brain, they'd just say Forge is the modding API and wipe their hands clean of the whole mess. They could just give the Forge team access to the source under NDA and then make Forge an artifact of Mojang's build. It'd still be decompilable Java, so it'd be as easy for us to edit at will, and it would at least lessen the "y u mean i ned forge how does i get" nonsense.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...