Sunday, February 1, 2015


Over the past few days (since Friday afternoon), I've been working on an annotation processor to help me deal with the many Forge annotations, and this is the result. It is called Kappa (Killjoy's Annotation Post Processor Application). Thanks to LexManos for the name. The source is available on GitHub.

It works with both 1.7 and 1.8 versions of Forge, but it does require Java 1.7 because of some String switches I use. What the Forge portion of this actually does is cause compile errors if the annotation isn't being used correctly, such as giving the wrong modifiers, providing the wrong return type, or wrong parameters. It also does type checking so things don't explode when you run it.

@Instance will check that the type is the same as the owner.

@SidedProxy is special. It will parse the clientSide and serverSide Strings and warn you when they don't exist. It will error if the types aren't compatible.

This is very easy to use with javac (simply add it to the classpath), but it's a bit involved with IDEs. See here for eclipse, and here for IntelliJ.

No comments:

Post a Comment