diff --git a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java index 05a70efa9..46235cf61 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java @@ -65,9 +65,6 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I public BlockFloatingSpecialFlower() { super(LibBlockNames.FLOATING_SPECIAL_FLOWER); - - GameRegistry.register(new SpecialFloatingFlowerRecipe(), new ResourceLocation(LibMisc.MOD_ID, "special_floating_flower")); - RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, ""); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index 4d6b2d4e9..b7854697e 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -25,24 +25,46 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import net.minecraftforge.registries.IForgeRegistry; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.common.Botania; import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.block.ModFluffBlocks; import vazkii.botania.common.block.tile.TileCraftCrate; import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.crafting.recipe.AesirRingRecipe; +import vazkii.botania.common.crafting.recipe.AncientWillRecipe; import vazkii.botania.common.crafting.recipe.ArmorUpgradeRecipe; +import vazkii.botania.common.crafting.recipe.BlackHoleTalismanExtractRecipe; +import vazkii.botania.common.crafting.recipe.CompositeLensRecipe; +import vazkii.botania.common.crafting.recipe.CosmeticAttachRecipe; +import vazkii.botania.common.crafting.recipe.CosmeticRemoveRecipe; +import vazkii.botania.common.crafting.recipe.HelmRevealingRecipe; +import vazkii.botania.common.crafting.recipe.KeepIvyRecipe; +import vazkii.botania.common.crafting.recipe.LensDyeingRecipe; +import vazkii.botania.common.crafting.recipe.ManaGunClipRecipe; +import vazkii.botania.common.crafting.recipe.ManaGunLensRecipe; +import vazkii.botania.common.crafting.recipe.ManaGunRemoveLensRecipe; import vazkii.botania.common.crafting.recipe.ManaUpgradeRecipe; +import vazkii.botania.common.crafting.recipe.PhantomInkRecipe; import vazkii.botania.common.crafting.recipe.ShapelessManaUpgradeRecipe; +import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe; +import vazkii.botania.common.crafting.recipe.SpellClothRecipe; +import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe; import vazkii.botania.common.item.ItemTwigWand; import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lib.LibMisc; import vazkii.botania.common.lib.LibOreDict; +@Mod.EventBusSubscriber public final class ModCraftingRecipes { public static IRecipe recipeLexicon; @@ -314,7 +336,55 @@ public final class ModCraftingRecipes { public static IRecipe recipeFelPumpkin; public static IRecipe recipeEndPortal; - public static void init() { + @SubscribeEvent + public static void registerRecipes(RegistryEvent.Register evt) { + IForgeRegistry r = evt.getRegistry(); + + r.register(new AesirRingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "aesir_ring"))); + RecipeSorter.register("botania:aesirRing", AesirRingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new AncientWillRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "ancient_will_attach"))); + RecipeSorter.register("botania:ancientWill", AncientWillRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new BlackHoleTalismanExtractRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "black_hole_talisman_extract"))); + RecipeSorter.register("botania:blackHoleTalismanExtract", BlackHoleTalismanExtractRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new SpellClothRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cleanse_enchants"))); + RecipeSorter.register("botania:spellCloth", SpellClothRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new CompositeLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "composite_lens"))); + RecipeSorter.register("botania:compositeLens", CompositeLensRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new CosmeticAttachRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach"))); + r.register(new CosmeticRemoveRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove"))); + RecipeSorter.register("botania:cosmeticAttach", CosmeticAttachRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + RecipeSorter.register("botania:cosmeticRemove", CosmeticRemoveRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new HelmRevealingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "helm_revealing"))); + RecipeSorter.register("botania:helmRevealing", HelmRevealingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new KeepIvyRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "keep_ivy_attach"))); + RecipeSorter.register("botania:keepIvy", KeepIvyRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new LensDyeingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "lens_dye"))); + RecipeSorter.register("botania:lensDying", LensDyeingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new ManaGunLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens"))); + r.register(new ManaGunRemoveLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens"))); + r.register(new ManaGunClipRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip"))); + RecipeSorter.register("botania:manaGunLens", ManaGunLensRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + RecipeSorter.register("botania:manaGunRemoveLens", ManaGunRemoveLensRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + RecipeSorter.register("botania:manaGunClip", ManaGunClipRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new PhantomInkRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "phantom_ink"))); + RecipeSorter.register("botania:phantomInk", PhantomInkRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new SpecialFloatingFlowerRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "special_floating_flower"))); + RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + + r.register(new TerraPickTippingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "terra_pick_tipping"))); + RecipeSorter.register("botania:terraPickTipping", TerraPickTippingRecipe.class, RecipeSorter.Category.SHAPELESS, ""); + int recipeListSize = CraftingManager.getInstance().getRecipeList().size(); // Lexicon Recipe diff --git a/src/main/java/vazkii/botania/common/item/ItemAncientWill.java b/src/main/java/vazkii/botania/common/item/ItemAncientWill.java index 09a2f86fd..670f7a53c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemAncientWill.java +++ b/src/main/java/vazkii/botania/common/item/ItemAncientWill.java @@ -41,9 +41,6 @@ public class ItemAncientWill extends ItemMod { super(LibItemNames.ANCIENT_WILL); setHasSubtypes(true); setMaxStackSize(1); - - GameRegistry.register(new AncientWillRecipe(), new ResourceLocation(LibMisc.MOD_ID, "ancient_will_attach")); - RecipeSorter.register("botania:ancientWill", AncientWillRecipe.class, Category.SHAPELESS, ""); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java index 445d5e0f2..9dc2f69dd 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java @@ -61,9 +61,6 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { super(LibItemNames.BLACK_HOLE_TALISMAN); setMaxStackSize(1); setHasSubtypes(true); - - GameRegistry.register(new BlackHoleTalismanExtractRecipe(), new ResourceLocation(LibMisc.MOD_ID, "black_hole_talisman_extract")); - RecipeSorter.register("botania:blackHoleTalismanExtract", BlackHoleTalismanExtractRecipe.class, Category.SHAPELESS, ""); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java b/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java index e55c87202..fd33fb7f7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java +++ b/src/main/java/vazkii/botania/common/item/ItemKeepIvy.java @@ -40,8 +40,6 @@ public class ItemKeepIvy extends ItemMod { public ItemKeepIvy() { super(LibItemNames.KEEP_IVY); - GameRegistry.register(new KeepIvyRecipe(), new ResourceLocation(LibMisc.MOD_ID, "keep_ivy_attach")); - RecipeSorter.register("botania:keepIvy", KeepIvyRecipe.class, Category.SHAPELESS, ""); MinecraftForge.EVENT_BUS.register(ItemKeepIvy.class); } diff --git a/src/main/java/vazkii/botania/common/item/ItemManaGun.java b/src/main/java/vazkii/botania/common/item/ItemManaGun.java index c55be0b26..b2c41e4c7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaGun.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaGun.java @@ -69,13 +69,6 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { setMaxDamage(COOLDOWN); setMaxStackSize(1); setNoRepair(); - - GameRegistry.register(new ManaGunLensRecipe(), new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens")); - GameRegistry.register(new ManaGunRemoveLensRecipe(), new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens")); - GameRegistry.register(new ManaGunClipRecipe(), new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip")); - RecipeSorter.register("botania:manaGunLens", ManaGunLensRecipe.class, Category.SHAPELESS, ""); - RecipeSorter.register("botania:manaGunRemoveLens", ManaGunRemoveLensRecipe.class, Category.SHAPELESS, ""); - RecipeSorter.register("botania:manaGunClip", ManaGunClipRecipe.class, Category.SHAPELESS, ""); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java b/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java index 6916038e8..1e6fe349c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java +++ b/src/main/java/vazkii/botania/common/item/ItemPhantomInk.java @@ -22,8 +22,6 @@ public class ItemPhantomInk extends ItemMod { public ItemPhantomInk() { super(LibItemNames.PHANTOM_INK); - GameRegistry.register(new PhantomInkRecipe(), new ResourceLocation(LibMisc.MOD_ID, "phantom_ink")); - RecipeSorter.register("botania:phantomInk", PhantomInkRecipe.class, Category.SHAPELESS, ""); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java b/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java index ab9e0c590..441fa717e 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpellCloth.java @@ -28,9 +28,6 @@ public class ItemSpellCloth extends ItemMod { setMaxDamage(35); setMaxStackSize(1); setNoRepair(); - - GameRegistry.register(new SpellClothRecipe(), new ResourceLocation(LibMisc.MOD_ID, "cleanse_enchants")); - RecipeSorter.register("botania:spellCloth", SpellClothRecipe.class, Category.SHAPELESS, ""); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java index 4958fc6fe..003702a81 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBaubleCosmetic.java @@ -69,11 +69,6 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble { public ItemBaubleCosmetic() { super(LibItemNames.COSMETIC); setHasSubtypes(true); - - GameRegistry.register(new CosmeticAttachRecipe(), new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach")); - GameRegistry.register(new CosmeticRemoveRecipe(), new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove")); - RecipeSorter.register("botania:cosmeticAttach", CosmeticAttachRecipe.class, Category.SHAPELESS, ""); - RecipeSorter.register("botania:cosmeticRemove", CosmeticRemoveRecipe.class, Category.SHAPELESS, ""); renderStack = new ItemStack(this); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java index e69906cf3..8fa26bcda 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java @@ -80,8 +80,6 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ public ItemTerraPick() { super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_PICK); - GameRegistry.register(new TerraPickTippingRecipe(), new ResourceLocation(LibMisc.MOD_ID, "terra_pick_tipping")); - RecipeSorter.register("botania:terraPickTipping", TerraPickTippingRecipe.class, Category.SHAPELESS, ""); addPropertyOverride(new ResourceLocation("botania", "tipped"), (itemStack, world, entityLivingBase) -> isTipped(itemStack) ? 1 : 0); addPropertyOverride(new ResourceLocation("botania", "enabled"), (itemStack, world, entityLivingBase) -> isEnabled(itemStack) ? 1 : 0); } diff --git a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java index 8efbbbbc1..df325e22d 100644 --- a/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java +++ b/src/main/java/vazkii/botania/common/item/interaction/thaumcraft/ItemManasteelHelmRevealing.java @@ -34,8 +34,6 @@ public class ItemManasteelHelmRevealing extends ItemManasteelHelm implements IGo public ItemManasteelHelmRevealing() { super(LibItemNames.MANASTEEL_HELM_R); - GameRegistry.register(new HelmRevealingRecipe(), new ResourceLocation(LibMisc.MOD_ID, "helm_revealing")); //Manasteel is the base so it gets the recipe added in its constructor so that ModItems can call it - RecipeSorter.register("botania:helmRevealing", HelmRevealingRecipe.class, Category.SHAPELESS, ""); } @Override diff --git a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java index 45bee9d85..f59d7a98d 100644 --- a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java +++ b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java @@ -153,11 +153,6 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens super(LibItemNames.LENS); setMaxStackSize(1); setHasSubtypes(true); - - GameRegistry.register(new CompositeLensRecipe(), new ResourceLocation(LibMisc.MOD_ID, "composite_lens")); - GameRegistry.register(new LensDyeingRecipe(), new ResourceLocation(LibMisc.MOD_ID, "lens_dye")); - RecipeSorter.register("botania:compositeLens", CompositeLensRecipe.class, Category.SHAPELESS, ""); - RecipeSorter.register("botania:lensDying", LensDyeingRecipe.class, Category.SHAPELESS, ""); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java index 2196b8483..91d39e864 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java @@ -46,8 +46,6 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina public ItemAesirRing() { super(LibItemNames.AESIR_RING); - GameRegistry.register(new AesirRingRecipe(), new ResourceLocation(LibMisc.MOD_ID, "aesir_ring")); - RecipeSorter.register("botania:aesirRing", AesirRingRecipe.class, Category.SHAPELESS, ""); MinecraftForge.EVENT_BUS.register(this); }