Compare commits

..
Author SHA1 Message Date
slprime e3cd7b860d Fix recipe result count (#767) 2025-10-18 11:07:39 +00:00
slprime 2a3aabc073 Add recipe index to recipe handler height (#768) 2025-10-18 13:03:08 +02:00
4 changed files with 7 additions and 5 deletions

No files matched your search

@@ -181,7 +181,7 @@ public class DebugHandlerWidget extends Widget implements IContainerInputHandler
@Override
public void draw(int mx, int my) {
this.field.setEnabled(handler.getRecipeHeight() <= 0);
this.field.setEnabled(handler.getRecipeHeight(0) <= 0);
super.draw(mx, my);
}
@@ -44,7 +44,7 @@ public interface IRecipeHandler {
return getRecipeName();
}
default int getRecipeHeight() {
default int getRecipeHeight(int recipe) {
return 0;
}
@@ -58,8 +58,8 @@ public class NEIRecipeWidget extends Widget {
this.w = Math.max(166, this.handlerInfo.getWidth());
if (this.showAsWidget || !this.handlerInfo.expandVertically()) {
this.h = this.handlerRef.handler.getRecipeHeight() > 0 ? this.handlerRef.handler.getRecipeHeight()
: this.handlerInfo.getHeight();
final int recipeHeight = this.handlerRef.handler.getRecipeHeight(this.handlerRef.recipeIndex);
this.h = recipeHeight > 0 ? recipeHeight : this.handlerInfo.getHeight();
this.h += this.handlerInfo.getYShift();
}
@@ -18,6 +18,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.api.ItemInfo;
@@ -311,7 +312,8 @@ public class Recipe {
}
public boolean contains(ItemStack stackA) {
return getPermutations().stream().anyMatch(stackB -> StackInfo.equalItemAndNBT(stackA, stackB, true));
return getPermutations().stream()
.anyMatch(stackB -> NEIClientUtils.areStacksSameTypeWithNBT(stackB, stackA));
}
public List<ItemStack> getPermutations() {