1313import net .minecraft .item .ItemStack ;
1414import net .minecraft .util .ResourceLocation ;
1515import net .minecraftforge .fml .common .Loader ;
16+ import net .minecraftforge .fml .common .Optional ;
1617import net .minecraftforge .fml .common .registry .GameRegistry ;
1718import org .jetbrains .annotations .NotNull ;
1819
@@ -35,45 +36,53 @@ public static ItemStack getOtherModsItemStack(String modId, String itemName) {
3536 @ Override
3637 public void register (final @ NotNull IModRegistry registry ) {
3738 JEIRecipeCatalyst .registration = registry ;
38- if (Loader .isModLoaded ("packagedexcrafting" )) {
39- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "combination_crafter" ), "extendedcrafting:combination_crafting" );
40- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "marked_pedestal" ), "extendedcrafting:combination_crafting" );
41- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "ender_crafter" ), "extendedcrafting:ender_crafting" );
42- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "advanced_crafter" ), "extendedcrafting:table_crafting_5x5" );
43- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "elite_crafter" ), "extendedcrafting:table_crafting_7x7" );
44- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedexcrafting" , "ultimate_crafter" ), "extendedcrafting:table_crafting_9x9" );
39+ final var exc = "packagedexcrafting" ;
40+ if (Loader .isModLoaded (exc )) {
41+ addRecipeCatalyst (exc , "combination_crafter" , "extendedcrafting:combination_crafting" );
42+ addRecipeCatalyst (exc , "marked_pedestal" , "extendedcrafting:combination_crafting" );
43+ addRecipeCatalyst (exc , "ender_crafter" , "extendedcrafting:ender_crafting" );
44+ addRecipeCatalyst (exc , "advanced_crafter" , "extendedcrafting:table_crafting_5x5" );
45+ addRecipeCatalyst (exc , "elite_crafter" , "extendedcrafting:table_crafting_7x7" );
46+ addRecipeCatalyst (exc , "ultimate_crafter" , "extendedcrafting:table_crafting_9x9" );
4547 }
4648 if (Loader .isModLoaded ("packagedavaritia" )) {
47- registration . addRecipeCatalyst (getOtherModsItemStack ( "packagedavaritia" , "extreme_crafter" ) , "Avatitia.Extreme" );
49+ addRecipeCatalyst ("packagedavaritia" , "extreme_crafter" , "Avatitia.Extreme" );
4850 }
49- if (Loader .isModLoaded ("packagedastral" )) {
50- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedastral" , "trait_crafter" ), "astralsorcery.altar.trait" );
51- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedastral" , "constellation_crafter" ), "astralsorcery.altar.constellation" );
52- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedastral" , "attunement_crafter" ), "astralsorcery.altar.attunement" );
53- registration .addRecipeCatalyst (getOtherModsItemStack ("packagedastral" , "discovery_crafter" ), "astralsorcery.altar.discovery" );
54- }
55- if (Loader .isModLoaded ("packageddraconic" )) {
56- registration .addRecipeCatalyst (getOtherModsItemStack ("packageddraconic" , "fusion_crafter" ), "DraconicEvolution.Fusion" );
57- }
58- if (Loader .isModLoaded ("ae2exttable" )) {
59- addExtended ();
51+ final var a = "packagedastral" ;
52+ if (Loader .isModLoaded (a )) {
53+ addRecipeCatalyst (a , "trait_crafter" , "astralsorcery.altar.trait" );
54+ addRecipeCatalyst (a , "constellation_crafter" , "astralsorcery.altar.constellation" );
55+ addRecipeCatalyst (a , "attunement_crafter" , "astralsorcery.altar.attunement" );
56+ addRecipeCatalyst (a , "discovery_crafter" , "astralsorcery.altar.discovery" );
6057 }
58+ if (Loader .isModLoaded ("packageddraconic" ))
59+ addRecipeCatalyst ("packageddraconic" , "fusion_crafter" , "DraconicEvolution.Fusion" );
60+ if (Loader .isModLoaded ("ae2exttable" )) addExtended ();
6161 }
6262
63+ @ Optional .Method (modid = "ae2exttable" )
6364 public void addExtended () {
64- registration .addRecipeCatalyst (ItemRegistry .BASIC_TERMINAL .getDefaultInstance (), VanillaRecipeCategoryUid .CRAFTING );
65- registration .addRecipeCatalyst (ItemRegistry .BASIC_TERMINAL .getDefaultInstance (), BasicTableCategory .UID );
66- registration .addRecipeCatalyst (ItemRegistry .WIRELESS_BASIC_TERMINAL .getDefaultInstance (), VanillaRecipeCategoryUid .CRAFTING );
67- registration .addRecipeCatalyst (ItemRegistry .WIRELESS_BASIC_TERMINAL .getDefaultInstance (), BasicTableCategory .UID );
65+ addRecipeCatalyst (ItemRegistry .BASIC_TERMINAL .getDefaultInstance (), VanillaRecipeCategoryUid .CRAFTING );
66+ addRecipeCatalyst (ItemRegistry .BASIC_TERMINAL .getDefaultInstance (), BasicTableCategory .UID );
67+ addRecipeCatalyst (ItemRegistry .WIRELESS_BASIC_TERMINAL .getDefaultInstance (), VanillaRecipeCategoryUid .CRAFTING );
68+ addRecipeCatalyst (ItemRegistry .WIRELESS_BASIC_TERMINAL .getDefaultInstance (), BasicTableCategory .UID );
69+
70+ addRecipeCatalyst (ItemRegistry .ADVANCED_TERMINAL .getDefaultInstance (), AdvancedTableCategory .UID );
71+ addRecipeCatalyst (ItemRegistry .WIRELESS_ADVANCED_TERMINAL .getDefaultInstance (), AdvancedTableCategory .UID );
6872
69- registration . addRecipeCatalyst (ItemRegistry .ADVANCED_TERMINAL .getDefaultInstance (), AdvancedTableCategory .UID );
70- registration . addRecipeCatalyst (ItemRegistry .WIRELESS_ADVANCED_TERMINAL .getDefaultInstance (), AdvancedTableCategory .UID );
73+ addRecipeCatalyst (ItemRegistry .ELITE_TERMINAL .getDefaultInstance (), EliteTableCategory .UID );
74+ addRecipeCatalyst (ItemRegistry .WIRELESS_ELITE_TERMINAL .getDefaultInstance (), EliteTableCategory .UID );
7175
72- registration .addRecipeCatalyst (ItemRegistry .ELITE_TERMINAL .getDefaultInstance (), EliteTableCategory .UID );
73- registration .addRecipeCatalyst (ItemRegistry .WIRELESS_ELITE_TERMINAL .getDefaultInstance (), EliteTableCategory .UID );
76+ addRecipeCatalyst (ItemRegistry .ULTIMATE_TERMINAL .getDefaultInstance (), UltimateTableCategory .UID );
77+ addRecipeCatalyst (ItemRegistry .WIRELESS_ULTIMATE_TERMINAL .getDefaultInstance (), UltimateTableCategory .UID );
78+ }
79+
80+ private void addRecipeCatalyst (String modid , String id , String ... jei ) {
81+ addRecipeCatalyst (getOtherModsItemStack (modid , id ), jei );
82+ }
7483
75- registration . addRecipeCatalyst ( ItemRegistry . ULTIMATE_TERMINAL . getDefaultInstance (), UltimateTableCategory . UID );
76- registration .addRecipeCatalyst (ItemRegistry . WIRELESS_ULTIMATE_TERMINAL . getDefaultInstance (), UltimateTableCategory . UID );
84+ private void addRecipeCatalyst ( ItemStack stack , String ... jei ) {
85+ registration .addRecipeCatalyst (stack , jei );
7786 }
7887
79- }
88+ }
0 commit comments