Compare commits

...
2 changed files with 15 additions and 5 deletions

No files matched your search

@@ -322,6 +322,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
}
};
this.container.x = this.guiLeft + 3;
this.container.y = this.guiTop + 32;
this.container.h = this.ySize - 32 - 5;
GuiRecipe.toggleSearch.icon = new DrawableBuilder("nei:textures/nei_sprites.png", 0, 76, 10, 10).build();
GuiRecipe.toggleSearch.w = GuiRecipe.toggleSearch.h = 12;
GuiRecipe.toggleSearch.x = this.guiLeft + BORDER_PADDING + BUTTON_WIDTH;
@@ -698,11 +702,7 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
public void updateScreen() {
super.updateScreen();
this.container.x = this.guiLeft + 3;
this.container.y = this.guiTop + 32;
this.container.w = Math.max(this.xSize - 6, this.handlerInfo.getWidth());
this.container.h = this.ySize - 32 - 5;
this.handler.original.onUpdate();
refreshPage();
@@ -23,6 +23,7 @@ import codechicken.nei.FavoriteRecipes;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.Widget;
import codechicken.nei.api.IGuiContainerOverlay;
@@ -344,7 +345,7 @@ public class NEIRecipeWidget extends Widget {
if (overStack != null && overStack.items.length > 1) {
final List<ItemStack> items = overStack.getFilteredPermutations();
final int stackIndex = overStack.getPermutationIndex(overStack.item);
final int stackIndex = indexOf(items, overStack.item);
final ItemStack stack = items.get((items.size() - scroll + stackIndex) % items.size());
Stream.concat(
@@ -359,6 +360,15 @@ public class NEIRecipeWidget extends Widget {
return false;
}
protected int indexOf(List<ItemStack> list, ItemStack stack) {
for (int i = 0; i < list.size(); i++) {
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(list.get(i), stack)) {
return i;
}
}
return -1;
}
protected <R> R forEachButtons(Function<GuiRecipeButton, R> callback, R defaultValue) {
for (GuiRecipeButton button : getRecipeButtonsIfInit()) {