Ignore my amalgamation of random bits of the FMP API, but this is a general "gist" of what's available. (I haven't actually played with FMP in quite a while, as the day-job doesn't allow me to work on "real" forge mods at the moment)
Code:
package com.apocdev.catalystmc;
import codechicken.multipart.IRandomUpdateTick;
import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.TMultiPart;
public class ExamplePart implements IRandomUpdateTick
{
@Override
public void randomUpdate()
{
MultiPartRegistry.registerParts(new ExamplePartFactory(), new String[]{ "my.custom.MultiPart", "my.custom.MultiPart2" });
// I don't think Java supports delegate-style callbacks, so implementing the part factory seems required.
// I'm C++/C# dev, so I may be totally off-base here.
// Note: I'm correct. Methods aren't considered first-class-citizens in the JVM, so passing around
// function pointers isn't going to happen. You need to implement the IPartFactory interface.
}
public class ExamplePartFactory implements MultiPartRegistry.IPartFactory
{
@Override
public TMultiPart createPart(String s, boolean b)
{
// Do your stuff to create the multipart object...
return null;
}
}
}
I'll assume you can just go through and check the FMP API for any other requirements, etc. Mapping from Scala->Java (at least from the API src docs) is fairly trivial.
Edit: The "registerParts" call needs to be done from mod.init(). Again, just check in the FMP src for any usage notes, etc.