Skip to content

Commit

Permalink
1.0.26
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyploszaj committed Dec 2, 2023
1 parent 577aac5 commit 219e6cd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
* Fixed highlighting for mods like Refined Storage
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions xplat/src/main/java/dev/emi/emi/jemi/JemiRecipeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public boolean supportsRecipe(EmiRecipe recipe) {

@Override
public boolean canCraft(EmiRecipe recipe, EmiCraftContext<T> 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<T> 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());
}
Expand All @@ -85,7 +85,9 @@ public boolean craft(EmiRecipe recipe, EmiCraftContext<T> context) {
@Override
public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> 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) {
Expand All @@ -95,8 +97,6 @@ public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> wi
}
}
}
R rawRecipe = getRawRecipe(recipe);
JemiRecipeSlotsView view = createSlotsView(recipe, rawRecipe, widgets);
if (view != null) {
view.getSlotViews().forEach(v -> {
if (v instanceof JemiRecipeSlot jrs) {
Expand All @@ -118,12 +118,14 @@ public void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> wi
}

@SuppressWarnings("unchecked")
private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext<T> context, boolean craft) {
private IRecipeTransferError jeiCraft(EmiRecipe recipe, EmiCraftContext<T> 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;
Expand Down

0 comments on commit 219e6cd

Please sign in to comment.