Skip to content

Commit

Permalink
Merge branch '1.20.2' into 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyploszaj committed Mar 10, 2024
2 parents 6223070 + a31c08b commit b0fcb0e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### Tweaks
* Search now has a history of previous queries #147
* Made mod name tooltip more likely to apply if other mods are making changes
* EMI's index construction is now slightly safer when other mods cause issues
* Added nullability annotation on EmiStackInteraction #455
* Allow identifier to be used for category property sorting #418
* Made EMI serverside optional on Neo

### API
* Added an experimental "recipe decorator" API
### Fixes
* Recipes from JEI not always getting assigned proper IDs #459
* NPE from certain mods instantiating screens in peculiar times and locations #449
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.1
enabled_platforms=fabric,forge

archives_base_name=emi
mod_version=1.1.2
mod_version=1.1.3
maven_group=dev.emi

architectury_version=4.9.83
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public static EmiPlayerInventory of(PlayerEntity entity) {
return handlers.get(0).getInventory((HandledScreen) screen);
}
}
if (entity == null) {
return new EmiPlayerInventory(List.of());
}
return new EmiPlayerInventory(entity);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.emi.emi.api.stack;

import dev.emi.emi.api.recipe.EmiRecipe;
import org.jetbrains.annotations.Nullable;

public class EmiStackInteraction {
public static final EmiStackInteraction EMPTY = new EmiStackInteraction(EmiStack.EMPTY, null, false);
Expand All @@ -18,7 +19,7 @@ public EmiStackInteraction(EmiIngredient stack) {
* @param clickable Whether this stack can be interacted with using a mouse for EMI functions.
* For example, stacks in the sidebar can, but stacks in the inventory cannot.
*/
public EmiStackInteraction(EmiIngredient stack, EmiRecipe recipe, boolean clickable) {
public EmiStackInteraction(EmiIngredient stack, @Nullable EmiRecipe recipe, boolean clickable) {
this.stack = stack;
this.recipe = recipe;
this.clickable = clickable;
Expand All @@ -28,6 +29,7 @@ public EmiIngredient getStack() {
return stack;
}

@Nullable
public EmiRecipe getRecipeContext() {
return recipe;
}
Expand Down
3 changes: 3 additions & 0 deletions xplat/src/main/java/dev/emi/emi/data/EmiData.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public static void init(Consumer<EmiResourceReloadListener> register) {
case "output_then_input":
props.sort = EmiRecipeSorting.compareOutputThenInput();
break;
case "identifier":
props.sort = EmiRecipeSorting.identifier();
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion xplat/src/main/java/dev/emi/emi/jemi/JemiRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public JemiRecipe(EmiRecipeCategory recipeCategory, IRecipeCategory<T> category,
this.category = category;
this.recipe = recipe;
this.originalId = category.getRegistryName(recipe);
if (id != null) {
if (this.originalId != null) {
this.id = new Identifier("jei", "/" + EmiUtil.subId(id));
}
category.setRecipe(builder, recipe, JemiPlugin.runtime.getJeiHelpers().getFocusFactory().getEmptyFocusGroup());
Expand Down
4 changes: 4 additions & 0 deletions xplat/src/main/java/dev/emi/emi/screen/EmiScreenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,10 @@ private static void renderSlotOverlays(EmiDrawContext context, int mouseX, int m
}

public static void addWidgets(Screen screen) {
EmiScreenBase base = EmiScreenBase.getCurrent();
if (base == null) {
return;
}
forceRecalculate();
if (EmiConfig.centerSearchBar) {
search.x = (screen.width - 160) / 2;
Expand Down

0 comments on commit b0fcb0e

Please sign in to comment.