%5Bbreaking Changes%5D What'S Different Between 0.1 Beta And 0.2 Beta
Well there's not much to do to update your mod to 0.2-beta.
Here's an example:
The old code:
public class EntityTest extends EntityCreature implements IAnimated
{
protected AnimationHandler animHandler = CraftStudioApi.getNewAnimationHandler(this);
public EntityTest(World par1World) {
super(par1World);
this.animHandler.addAnim(Mod_Test.MODID, "position", "craftstudio_api_test", true);
}
...
}The new code:
public class EntityTest extends EntityCreature implements IAnimated
{
protected static AnimationHandler animHandler = CraftStudioApi.getNewAnimationHandler(EntityTest.class);
static {
EntityTest.animHandler.addAnim(Mod_Test.MODID, "position", "craftstudio_api_test", true);
}
public EntityTest(World par1World) {
super(par1World);
EntityTest.animHandler.addAnimated(this);
}
...
}As you can see there's three main changes:
- The AnimationHandler is now static and take the Entity class as argument.
- As the AnimationHandler is the same for all Entity of a type you must add animation in a static block to avoid adding an animation multiple times.
- You still need to tell the AnimationHandler that your entity is animated, so you must add the
addAnimated()with the Entity that is animated (thishere).