Skip to content

Commit 4c7dc53

Browse files
authored
Fix EMI warnings for synthetic recipe ids (#1011)
1 parent eeb39ab commit 4c7dc53

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/client/java/aztech/modern_industrialization/compat/viewer/usage/FluidFuelsCategory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ public void buildWidgets(Fluid recipe, WidgetList widgets) {
7777

7878
@Override
7979
public ResourceLocation getRecipeId(Fluid recipe) {
80-
return MI.id("fluid_fuels/" + BuiltInRegistries.FLUID.getKey(recipe).toString().replace(':', '_'));
80+
return MI.id("/fluid_fuels/" + BuiltInRegistries.FLUID.getKey(recipe).toString().replace(':', '_'));
8181
}
8282
}

src/client/java/aztech/modern_industrialization/compat/viewer/usage/MultiblockCategory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public Recipe(ResourceLocation controller, ShapeTemplate shapeTemplate, @Nullabl
109109
this.materials.add(new ItemStack(entry.getKey(), entry.getValue()));
110110
}
111111
this.id = ResourceLocation.fromNamespaceAndPath(controller.getNamespace(),
112-
controller.getPath() + "/" + materials.size() + (alternative == null ? "" : "/" + alternative));
112+
"/" + controller.getPath() + "/" + materials.size() + (alternative == null ? "" : "/" + alternative));
113113
}
114114
}
115115
}

src/main/java/aztech/modern_industrialization/machines/recipe/RecipeConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
public class RecipeConversions {
4646

4747
public static RecipeHolder<MachineRecipe> ofSmelting(RecipeHolder<SmeltingRecipe> holder, MachineRecipeType type, RegistryAccess registryAccess) {
48-
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(holder.id().getNamespace(), holder.id().getPath() + "_exported_mi_furnace");
48+
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(holder.id().getNamespace(), "/" + holder.id().getPath() + "_exported_mi_furnace");
4949
var smeltingRecipe = holder.value();
5050
Ingredient ingredient = smeltingRecipe.getIngredients().get(0);
5151
MachineRecipe recipe = new MachineRecipe(type);
@@ -62,7 +62,7 @@ public static RecipeHolder<MachineRecipe> ofSmelting(RecipeHolder<SmeltingRecipe
6262
public static RecipeHolder<MachineRecipe> ofStonecutting(RecipeHolder<StonecutterRecipe> holder, MachineRecipeType type,
6363
RegistryAccess registryAccess) {
6464
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(holder.id().getNamespace(),
65-
holder.id().getPath() + "_exported_mi_cutting_machine");
65+
"/" + holder.id().getPath() + "_exported_mi_cutting_machine");
6666
var stonecuttingRecipe = holder.value();
6767
MachineRecipe recipe = new MachineRecipe(type);
6868
recipe.eu = 2;
@@ -85,7 +85,7 @@ public static RecipeHolder<MachineRecipe> ofCompostable(ItemLike compostable) {
8585

8686
float probability = ComposterBlock.COMPOSTABLES.getOrDefault(compostable.asItem(), 0.0F);
8787
if (probability > 0.0F) {
88-
ResourceLocation id = MI.id(BuiltInRegistries.ITEM.getKey(compostable.asItem()).getPath() + "_to_plant_oil");
88+
ResourceLocation id = MI.id("/" + BuiltInRegistries.ITEM.getKey(compostable.asItem()).getPath() + "_to_plant_oil");
8989
MachineRecipe plantOil = new MachineRecipe(MIMachineRecipeTypes.CENTRIFUGE);
9090
plantOil.eu = 8;
9191
plantOil.duration = 200;

src/main/java/aztech/modern_industrialization/nuclear/INuclearComponent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ default int getMaxTemperature() {
5656
static ResourceLocation getEmiRecipeId(INuclearComponent<?> component, String category, String type) {
5757
return switch (component.getVariant()) {
5858
case ItemVariant itemVariant ->
59-
BuiltInRegistries.ITEM.getKey(itemVariant.getItem()).withPrefix(category + "/item/").withSuffix("/" + type);
59+
BuiltInRegistries.ITEM.getKey(itemVariant.getItem()).withPrefix("/" + category + "/item/").withSuffix("/" + type);
6060
case FluidVariant fluidVariant ->
61-
BuiltInRegistries.FLUID.getKey(fluidVariant.getFluid()).withPrefix(category + "/fluid/").withSuffix("/" + type);
61+
BuiltInRegistries.FLUID.getKey(fluidVariant.getFluid()).withPrefix("/" + category + "/fluid/").withSuffix("/" + type);
6262
case Object object -> throw new IllegalArgumentException("Unknown component variant " + object);
6363
};
6464
}

0 commit comments

Comments
 (0)