16
16
import com .simibubi .create .compat .emi .recipes .AutomaticPackingEmiRecipe ;
17
17
import com .simibubi .create .compat .emi .recipes .BlockCuttingEmiRecipe ;
18
18
import com .simibubi .create .compat .emi .recipes .BlockCuttingEmiRecipe .CondensedBlockCuttingRecipe ;
19
+ import com .simibubi .create .compat .emi .recipes .ConversionRecipe ;
19
20
import com .simibubi .create .compat .emi .recipes .CreateEmiRecipe ;
20
21
import com .simibubi .create .compat .emi .recipes .CrushingEmiRecipe ;
21
22
import com .simibubi .create .compat .emi .recipes .DeployingEmiRecipe ;
38
39
import com .simibubi .create .compat .emi .recipes .fan .FanSmokingEmiRecipe ;
39
40
import com .simibubi .create .compat .emi .recipes .fan .FanWashingEmiRecipe ;
40
41
import com .simibubi .create .compat .recipeViewerCommon .HiddenItems ;
41
- import com .simibubi .create .compat .rei .ConversionRecipe ;
42
42
import com .simibubi .create .compat .rei .ToolboxColoringRecipeMaker ;
43
43
import com .simibubi .create .content .decoration .palettes .AllPaletteStoneTypes ;
44
44
import com .simibubi .create .content .equipment .blueprint .BlueprintScreen ;
@@ -321,21 +321,14 @@ private void addLavaCollision(EmiRegistry registry, FluidEntry<?> fluid, AllPale
321
321
322
322
registry .addRecipe (
323
323
EmiWorldInteractionRecipe .builder ()
324
- .id (synthetic ("emi/ fluid_interaction/" + blockName ))
324
+ .id (synthetic ("fluid_interaction/" + blockName ))
325
325
.leftInput (fluidStack )
326
326
.rightInput (lava , false )
327
327
.output (output )
328
328
.build ()
329
329
);
330
330
}
331
331
332
- private static ResourceLocation synthetic (String path ) {
333
- if (path .startsWith ("/" ))
334
- throw new IllegalArgumentException ("Starting slash is added automatically" );
335
- // EMI recommends starting synthetic IDs with a slash so that they can't possibly conflict with data packs.
336
- return Create .asResource ('/' + path );
337
- }
338
-
339
332
private void addDeferredRecipes (Consumer <EmiRecipe > consumer ) {
340
333
List <Fluid > fluids = EmiApi .getIndexStacks ().stream ()
341
334
.filter (s -> s .getKey () instanceof Fluid )
@@ -351,14 +344,14 @@ private void addDeferredRecipes(Consumer<EmiRecipe> consumer) {
351
344
ResourceLocation iid = BuiltInRegistries .ITEM .getKey (i );
352
345
ResourceLocation pid = BuiltInRegistries .POTION .getKey (PotionUtils .getPotion (is ));
353
346
consumer .accept (new SpoutEmiRecipe (new ProcessingRecipeBuilder <>(FillingRecipe ::new ,
354
- new ResourceLocation ( "emi" , "create/ potion_filling/" + pid .getNamespace () + "/" + pid .getPath ()
347
+ synthetic ( " potion_filling/" + pid .getNamespace () + "/" + pid .getPath ()
355
348
+ "/from/" + iid .getNamespace () + "/" + iid .getPath ()))
356
349
.withItemIngredients (bottle )
357
350
.withFluidIngredients (FluidIngredient .fromFluidStack (potion ))
358
351
.withSingleItemOutput (is .copy ())
359
352
.build ()));
360
353
consumer .accept (new DrainEmiRecipe (new ProcessingRecipeBuilder <>(EmptyingRecipe ::new ,
361
- new ResourceLocation ( "emi" , "create/ potion_draining/" + pid .getNamespace () + "/" + pid .getPath ()
354
+ synthetic ( " potion_draining/" + pid .getNamespace () + "/" + pid .getPath ()
362
355
+ "/from/" + iid .getNamespace () + "/" + iid .getPath ()))
363
356
.withItemIngredients (Ingredient .of (is ))
364
357
.withFluidOutputs (potion )
@@ -388,7 +381,7 @@ private void addDeferredRecipes(Consumer<EmiRecipe> consumer) {
388
381
ResourceLocation itemId = BuiltInRegistries .ITEM .getKey (is .getItem ());
389
382
ResourceLocation fluidId = BuiltInRegistries .FLUID .getKey (fs .getFluid ());
390
383
consumer .accept (new SpoutEmiRecipe (new ProcessingRecipeBuilder <>(FillingRecipe ::new ,
391
- new ResourceLocation ( "emi" , "create/ filling/" + itemId .getNamespace () + "/" + itemId .getPath ()
384
+ synthetic ( " filling/" + itemId .getNamespace () + "/" + itemId .getPath ()
392
385
+ "/with/" + fluidId .getNamespace () + "/" + fluidId .getPath ()))
393
386
.withItemIngredients (bucket )
394
387
.withFluidIngredients (FluidIngredient .fromFluidStack (fs ))
@@ -407,7 +400,7 @@ private void addDeferredRecipes(Consumer<EmiRecipe> consumer) {
407
400
ResourceLocation itemId = BuiltInRegistries .ITEM .getKey (is .getItem ());
408
401
ResourceLocation fluidId = BuiltInRegistries .FLUID .getKey (extracted .getFluid ());
409
402
consumer .accept (new DrainEmiRecipe (new ProcessingRecipeBuilder <>(EmptyingRecipe ::new ,
410
- new ResourceLocation ( "emi" , "create/ draining/" + itemId .getNamespace () + "/" + itemId .getPath ()
403
+ synthetic ( " draining/" + itemId .getNamespace () + "/" + itemId .getPath ()
411
404
+ "/from/" + fluidId .getNamespace () + "/" + fluidId .getPath ()))
412
405
.withItemIngredients (Ingredient .of (is ))
413
406
.withFluidOutputs (extracted )
@@ -436,11 +429,11 @@ public void registerGeneratedRecipes(EmiRegistry registry) {
436
429
if (toolbox == null || dye == null ) return ;
437
430
ResourceLocation toolboxId = BuiltInRegistries .ITEM .getKey (toolbox .getItem ());
438
431
ResourceLocation dyeId = BuiltInRegistries .ITEM .getKey (dye .getItem ());
439
- String recipeName = "create/ toolboxes/%s/%s/%s/%s"
432
+ String recipeName = "toolboxes/%s/%s/%s/%s"
440
433
.formatted (toolboxId .getNamespace (), toolboxId .getPath (), dyeId .getNamespace (), dyeId .getPath ());
441
434
registry .addRecipe (new EmiCraftingRecipe (
442
435
r .getIngredients ().stream ().map (EmiIngredient ::of ).toList (),
443
- CreateEmiRecipe .getResultEmi (r ), new ResourceLocation ( "emi" , recipeName )));
436
+ CreateEmiRecipe .getResultEmi (r ), synthetic ( recipeName )));
444
437
});
445
438
// for EMI we don't do this since it already has a category, World Interaction
446
439
// LogStrippingFakeRecipes.createRecipes().forEach(r -> {
@@ -460,6 +453,21 @@ public static boolean doInputsMatch(Recipe<?> a, Recipe<?> b) {
460
453
return false ;
461
454
}
462
455
456
+ public static ResourceLocation synthetic (String path ) {
457
+ if (path .startsWith ("/" ))
458
+ throw new IllegalArgumentException ("Starting slash is added automatically" );
459
+ // EMI recommends starting synthetic IDs with a slash so that they can't possibly conflict with data packs.
460
+ return Create .asResource ('/' + path );
461
+ }
462
+
463
+ public static ResourceLocation synthetic (ResourceLocation id ) {
464
+ return id .withPrefix ("/" );
465
+ }
466
+
467
+ public static ResourceLocation syntheticOf (String prefix , ResourceLocation base ) {
468
+ return synthetic (prefix + '/' + base .getNamespace () + '/' + base .getPath ());
469
+ }
470
+
463
471
private static EmiRecipeCategory register (String name , EmiRenderable icon ) {
464
472
ResourceLocation id = Create .asResource (name );
465
473
EmiRecipeCategory category = new EmiRecipeCategory (id , icon );
0 commit comments