32
32
import java .util .Map ;
33
33
import java .util .stream .Collectors ;
34
34
35
+ import static me .chikage .emicompat .EmiCompatPlugin .addAll ;
36
+
35
37
36
38
public class Ae2Plugin implements EmiPlugin {
37
39
public static final Map <ResourceLocation , EmiRecipeCategory > ALL = new LinkedHashMap <>();
@@ -46,7 +48,6 @@ public class Ae2Plugin implements EmiPlugin {
46
48
47
49
@ Override
48
50
public void register (EmiRegistry registry ) {
49
- var recipes = registry .getRecipeManager ();
50
51
ALL .forEach ((id , category ) -> registry .addCategory (category ));
51
52
52
53
registry .addWorkstation (VanillaEmiRecipeCategories .CRAFTING , EmiStack .of (AEParts .CRAFTING_TERMINAL .stack ()));
@@ -63,9 +64,7 @@ public void register(EmiRegistry registry) {
63
64
});
64
65
65
66
registry .addWorkstation (INSCRIBER , EmiStack .of (AEBlocks .INSCRIBER .stack ()));
66
- recipes .getAllRecipesFor (InscriberRecipe .TYPE ).stream ()
67
- .parallel ().map (EMIInscriberRecipe ::new )
68
- .forEach (registry ::addRecipe );
67
+ addAll (registry ,InscriberRecipe .TYPE ,EMIInscriberRecipe ::new );
69
68
70
69
registry .addWorkstation (CONDENSER , EmiStack .of (AEBlocks .CONDENSER .stack ()));
71
70
registry .addRecipe (new EMICondenserRecipe (CondenserOutput .MATTER_BALLS ));
@@ -76,14 +75,10 @@ public void register(EmiRegistry registry) {
76
75
List .of (EmiStack .of (entry .getValue ()))));
77
76
}
78
77
79
- recipes .getAllRecipesFor (TransformRecipe .TYPE ).stream ()
80
- .parallel ().map (EMIItemTransformationRecipe ::new )
81
- .forEach (registry ::addRecipe );
78
+ addAll (registry ,TransformRecipe .TYPE ,EMIItemTransformationRecipe ::new );
82
79
83
80
registry .addWorkstation (CHARGER , EmiStack .of (AEBlocks .CHARGER .stack ()));
84
- recipes .getAllRecipesFor (ChargerRecipe .TYPE ).stream ()
85
- .parallel ().map (EMIChargerRecipe ::new )
86
- .forEach (registry ::addRecipe );
81
+ addAll (registry ,ChargerRecipe .TYPE ,EMIChargerRecipe ::new );
87
82
}
88
83
89
84
private static EmiRecipeCategory register (String name , EmiRenderable icon ) {
@@ -94,7 +89,8 @@ private static EmiRecipeCategory register(String name, EmiRenderable icon) {
94
89
}
95
90
96
91
97
- public static List <Bounds > mapRects (List <Rect2i > exclusionZones ) {
92
+
93
+ private static List <Bounds > mapRects (List <Rect2i > exclusionZones ) {
98
94
return exclusionZones .stream ()
99
95
.map (ez -> new Bounds (ez .getX (), ez .getY (), ez .getWidth (), ez .getHeight ()))
100
96
.collect (Collectors .toList ());
0 commit comments