diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d81dc796..aaff95fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,11 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-gradle - - name: Build - run: ./gradlew build + - name: Build Fabric + run: ./gradlew :fabric:build + + - name: Build Forge + run: ./gradlew :forge:build - name: Upload Artifacts uses: actions/upload-artifact@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7787c6cc..24898b3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,12 +39,22 @@ jobs: id: composite_version run: echo "composite_version=${{ steps.mod_version.outputs.mod_version }}+${{ steps.minecraft_version.outputs.minecraft_version }}" >> $GITHUB_OUTPUT + - name: Build Fabric + env: + RELEASE: true + run: ./gradlew :fabric:build + + - name: Build Forge + env: + RELEASE: true + run: ./gradlew :forge:build + - name: Publish env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} RELEASE: true - run: ./gradlew build publish modrinth curseforge -PmavenUrl="${{ secrets.MAVEN_URL }}" -PmavenUsername="${{ secrets.MAVEN_USERNAME }}" -PmavenPassword="${{ secrets.MAVEN_PASSWORD }}" + run: ./gradlew publish modrinth curseforge -PmavenUrl="${{ secrets.MAVEN_URL }}" -PmavenUsername="${{ secrets.MAVEN_USERNAME }}" -PmavenPassword="${{ secrets.MAVEN_PASSWORD }}" - name: Create Release id: create_release diff --git a/CHANGELOG.md b/CHANGELOG.md index 5edd35f7..1e75a5e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ ### Additions -* Added option to use all registered items instead of creative tabs to source the index. -* Added tab scrolling on hover #308 -* Added better support for JEI slot highlighting +* Updated Chinese translation ### Fixes -* Fixed ingredient serializer errors #354 -* Fixed #346 \ No newline at end of file +* Fixed highlighting for mods like Refined Storage \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 45b9ed29..9d951088 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.20.2 enabled_platforms=fabric,forge archives_base_name=emi -mod_version=1.0.25 +mod_version=1.0.26 maven_group=dev.emi architectury_version=4.9.83 diff --git a/xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java b/xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java index 603c826a..b41d63dd 100644 --- a/xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java +++ b/xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java @@ -69,13 +69,13 @@ public boolean supportsRecipe(EmiRecipe recipe) { @Override public boolean canCraft(EmiRecipe recipe, EmiCraftContext context) { - IRecipeTransferError err = jeiCraft(recipe, context, false); + IRecipeTransferError err = jeiCraft(recipe, context, false, null); return err == null || err.getType().allowsTransfer; } @Override public boolean craft(EmiRecipe recipe, EmiCraftContext context) { - IRecipeTransferError err = jeiCraft(recipe, context, true); + IRecipeTransferError err = jeiCraft(recipe, context, true, null); if (err == null || err.getType().allowsTransfer) { MinecraftClient.getInstance().setScreen(context.getScreen()); } @@ -85,7 +85,9 @@ public boolean craft(EmiRecipe recipe, EmiCraftContext context) { @Override public void render(EmiRecipe recipe, EmiCraftContext context, List widgets, DrawContext raw) { EmiDrawContext draw = EmiDrawContext.wrap(raw); - IRecipeTransferError err = jeiCraft(recipe, context, false); + R rawRecipe = getRawRecipe(recipe); + JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, widgets); + IRecipeTransferError err = jeiCraft(recipe, context, false, view); if (err != null) { if (err.getType() == IRecipeTransferError.Type.COSMETIC) { for (Widget widget : widgets) { @@ -95,8 +97,6 @@ public void render(EmiRecipe recipe, EmiCraftContext context, List wi } } } - R rawRecipe = getRawRecipe(recipe); - JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, widgets); if (view != null) { view.getSlotViews().forEach(v -> { if (v instanceof JemiRecipeSlot jrs) { @@ -118,12 +118,14 @@ public void render(EmiRecipe recipe, EmiCraftContext context, List wi } @SuppressWarnings("unchecked") - private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext context, boolean craft) { + private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext context, boolean craft, JemiRecipeSlotsView view) { try { MinecraftClient client = MinecraftClient.getInstance(); R rawRecipe = getRawRecipe(recipe); - JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, List.of()); + if (view == null) { + view = createSlotsView(recipe, rawRecipe, List.of()); + } if (view == null) { return () -> IRecipeTransferError.Type.INTERNAL;