Just Enough Items (JEI)

Just Enough Items (JEI)

495M Downloads

[Bug]: Several classes fail to unmap when trying to use the JEI API with Yarn mappings with fabric loom.

WhyAreAllTheseTaken opened this issue ยท 1 comments

commented

Steps to Reproduce the Bug

  1. Add the following to build.gradle's dependencies section:
// compile against the JEI API but do not include it at runtime
modCompileOnlyApi("mezz.jei:jei-${project.minecraft_version}-fabric-api:${jei_version}")
// at runtime, use the full JEI jar for Fabric
modRuntimeOnly("mezz.jei:jei-${project.minecraft_version}-fabric:${jei_version}")
  1. Add the following in gradle.properties:
minecraft_version=1.21.10
yarn_mappings=1.21.10+build.2
loader_version=0.17.3
loom_version=1.13-SNAPSHOT
fabric_version=0.138.0+1.21.10
jei_version=26.1.0.16
  1. Define the following recipe category (Note the class names starting with Tech are from the mod I'm developing and are just there to show the code that produced the issue. Any recipe type should trigger the issue).
class MortarJEIRecipeCategory extends AbstractRecipeCategory<RecipeEntry<MortarRecipe>> {
	public MortarJEIRecipeCategory() {
		super(IRecipeType.create(TechRecipes.MORTAR_RECIPE_TYPE), Text.translatable("dyntech.recipe.mortar"), null, 480, 360);
	}

	@Override
	public void setRecipe(IRecipeLayoutBuilder builder, RecipeEntry<MortarRecipe> recipe, IFocusGroup focuses) {
	    builder.addInputSlot().setStandardSlotBackground()
            .add(recipe.value().input());

        builder.addOutputSlot().setOutputSlotBackground()
            .add(recipe.value().output());
    }
}
  1. Define the following JEI plugin:
public class TechJEIPlugin implements IModPlugin {
    private static final Identifier IDENTIFIER = Identifier.of(DynamicTechnology.MOD_ID, "recipe");
    private static final MortarJEIRecipeCategory MORTAR_CATEGORY = new MortarJEIRecipeCategory();

    @Override
    public Identifier getPluginUid() {
	    return IDENTIFIER;
    }

    @Override
    public void registerCategories(IRecipeCategoryRegistration registration) {
        registration.addRecipeCategories(MORTAR_CATEGORY);
    }

    @Override
    public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
        registration.addCraftingStation(IRecipeType.create(RecipeType.SMELTING), TechBlocks.PIT_FIRE);
        registration.addCraftingStation(MORTAR_CATEGORY.getRecipeType(), TechBlocks.MORTAR);
    }
}
  1. Attempt to compile and run the mod with gradle runClient.

Expected Behavior

The mod compiles and Minecraft launches.

Actual Behavior

The mod fails to compile with the following compile errors:

  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/TechJEIPlugin.java:22: error: getPluginUid() in TechJEIPlugin cannot implement getPluginUid() in IModPlugin
  	public Identifier getPluginUid() {
  	                  ^
    return type Identifier is not compatible with class_2960
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/TechJEIPlugin.java:15: error: cannot access class_2960
  public class TechJEIPlugin implements IModPlugin {
         ^
    class file for net.minecraft.class_2960 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/TechJEIPlugin.java:33: error: cannot access class_1860
          registration.addCraftingStation(IRecipeType.create(RecipeType.SMELTING), TechBlocks.PIT_FIRE);
                                                     ^
    class file for net.minecraft.class_1860 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/TechJEIPlugin.java:33: error: cannot access class_1799
          registration.addCraftingStation(IRecipeType.create(RecipeType.SMELTING), TechBlocks.PIT_FIRE);
                      ^
    class file for net.minecraft.class_1799 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/TechJEIPlugin.java:34: error: cannot access class_1935
          registration.addCraftingStation(MORTAR_CATEGORY.getRecipeType(), TechBlocks.MORTAR);
                      ^
    class file for net.minecraft.class_1935 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/MortarJEIRecipeCategory.java:18: error: cannot access class_3956
  		super(IRecipeType.create(TechRecipes.MORTAR_RECIPE_TYPE), Text.translatable("dyntech.recipe.mortar"), null, 480, 360);
  		                 ^
    class file for net.minecraft.class_3956 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/MortarJEIRecipeCategory.java:18: error: cannot access class_2561
  		super(IRecipeType.create(TechRecipes.MORTAR_RECIPE_TYPE), Text.translatable("dyntech.recipe.mortar"), null, 480, 360);
  		     ^
    class file for net.minecraft.class_2561 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/MortarJEIRecipeCategory.java:24: error: cannot access class_1856
              .add(recipe.value().input());
              ^
    class file for net.minecraft.class_1856 not found
  /home/lucy/dev/dyntech/src/main/java/io/github/whyareallthesetaken/dyntech/integration/jei/MortarJEIRecipeCategory.java:27: error: cannot access class_3611
              .add(recipe.value().output());
              ^
    class file for net.minecraft.class_3611 not found

Additionally during building the following errors are printed:

Cannot remap method_3345 because it does not exists in any of the targets [net/minecraft/class_775]
Cannot remap method_3786 because it does not exists in any of the targets [net/minecraft/server/MinecraftServer]
Cannot remap method_3786 because it does not exists in any of the targets [net/minecraft/server/MinecraftServer]
Cannot remap method_3345 because it does not exists in any of the targets [net/minecraft/class_775]
Cannot remap method_3786 because it does not exists in any of the targets [net/minecraft/server/MinecraftServer]
Cannot remap method_3345 because it does not exists in any of the targets [net/minecraft/class_775]

Mod Pack URL (Optional)

No response

Mod Pack Version (Optional)

No response

Extra Notes (Optional)

I think the following classes are not being mapped correctly:

  1. ResourceLocation -> class_2960 -> Identifier
  2. Recipe -> class_1860 -> Recipe
  3. ItemLike -> class_1935 -> ItemConvertible
  4. ItemStack -> class_1799 -> ItemStack
  5. RecipeType -> class_3956 -> RecipeType
  6. Component -> class_2561 -> Text
  7. Ingredient -> class_1856 -> Ingredient
  8. Fluid -> class_3611 -> Fluid

Based on the number of errors, I'm not sure if anything is getting remapped correctly.

latest.log

No response

commented

I'm also experiencing this issue.