Add API method for registering recipes at proper time

The old access to IBloodMagicRecipeRegistrar still exists, but should not
be used so mods like CraftTweaker can do their thing.

This commit also introduces @BloodMagicPlugin.Inject which will inject the
active API instance into an annotated field with the API interface as it's
type. These fields are populated during pre init.
This commit is contained in:
Nicholas Ignoffo 2018-02-28 17:53:23 -08:00
parent 395f1188e7
commit 91d7f23b4f
7 changed files with 125 additions and 18 deletions

View file

@ -12,6 +12,7 @@ import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid;
import WayofTime.bloodmagic.item.alchemy.ItemLivingArmourPointsUpgrade;
import WayofTime.bloodmagic.item.soul.ItemSoulGem;
import WayofTime.bloodmagic.item.types.ComponentTypes;
import WayofTime.bloodmagic.util.PluginUtil;
import com.google.common.collect.Sets;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@ -51,6 +52,8 @@ public class RegistrarBloodMagicRecipes {
OreDictionary.registerOre("dustIron", ComponentTypes.SAND_IRON.getStack());
OreDictionary.registerOre("dustGold", ComponentTypes.SAND_GOLD.getStack());
OreDictionary.registerOre("dustCoal", ComponentTypes.SAND_COAL.getStack());
PluginUtil.handlePluginStep(PluginUtil.RegistrationStep.RECIPE_REGISTER);
}
public static void registerAltarRecipes(BloodMagicRecipeRegistrar registrar) {