diff --git a/src/main/java/codechicken/nei/AbstractSubpanel.java b/src/main/java/codechicken/nei/AbstractSubpanel.java new file mode 100644 index 00000000..61c6f09f --- /dev/null +++ b/src/main/java/codechicken/nei/AbstractSubpanel.java @@ -0,0 +1,141 @@ +package codechicken.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + +import codechicken.nei.ItemsGrid.ItemsGridSlot; +import codechicken.nei.drawable.DrawableBuilder; +import codechicken.nei.drawable.DrawableResource; +import codechicken.nei.guihook.IContainerTooltipHandler; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; + +public abstract class AbstractSubpanel> + extends Widget implements IContainerTooltipHandler { + + final DrawableResource DASH = new DrawableBuilder("nei:textures/dash.png", 0, 0, 6, 1).setTextureSize(6, 1).build(); + + protected int mouseDownItemIndex = -1; + protected int splittingLineColor = 0xffffffff; + protected T grid; + + public boolean isEmpty() { + return this.grid.isEmpty(); + } + + public void draw(int mousex, int mousey) { + drawSplittingLine(); + this.grid.draw(mousex, mousey); + } + + public void update() { + this.grid.update(); + } + + public abstract int setPanelWidth(int width); + + public void resize(GuiContainer gui) { + this.grid.setGridSize(x, y + 4, w, h - 8); + this.grid.refresh(gui); + } + + @Override + public ItemStack getStackMouseOver(int mousex, int mousey) { + final ItemsGridSlot slot = getSlotMouseOver(mousex, mousey); + return slot == null ? null : slot.getItemStack(); + } + + public ItemsGridSlot getSlotMouseOver(int mousex, int mousey) { + return this.grid.getSlotMouseOver(mousex, mousey); + } + + protected void drawSplittingLine() { + float alpha = (this.splittingLineColor >> 24 & 255) / 255.0F; + float red = (this.splittingLineColor >> 16 & 255) / 255.0F; + float green = (this.splittingLineColor >> 8 & 255) / 255.0F; + float blue = (this.splittingLineColor & 255) / 255.0F; + + int width = this.grid.columns * ItemsGrid.SLOT_SIZE; + int repeat = width / 6; + int shiftX = this.x + (this.w - width) / 2; + + GL11.glColor4f(red, green, blue, alpha); + for (int i = 0; i < repeat; i++) { + DASH.draw(shiftX + i * 6, y); + } + GL11.glColor4f(1, 1, 1, 1); + } + + @Override + public void mouseDragged(int mousex, int mousey, int button, long heldTime) { + + if (this.mouseDownItemIndex >= 0 && ItemPanels.itemPanel.draggedStack == null + && NEIClientUtils.getHeldItem() == null + && NEIClientConfig.hasSMPCounterPart()) { + + final ItemsGridSlot mouseOverSlot = getSlotMouseOver(mousex, mousey); + + if (mouseOverSlot == null || mouseOverSlot.itemIndex != this.mouseDownItemIndex || heldTime > 500) { + ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity( + this.grid.getItem(this.mouseDownItemIndex)); + this.mouseDownItemIndex = -1; + } + } + + } + + @Override + public boolean handleClick(int mousex, int mousey, int button) { + if (handleClickExt(mousex, mousey, button)) return true; + + final ItemsGridSlot hoverSlot = this.grid.getSlotMouseOver(mousex, mousey); + if (hoverSlot != null) { + + if (button == 2) { + ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity(hoverSlot.getItemStack()); + } else { + mouseDownItemIndex = hoverSlot.itemIndex; + } + + return true; + } + + return false; + } + + protected abstract ItemStack getDraggedStackWithQuantity(ItemStack itemStack); + + public ItemStack getStackMouseOverWithQuantity(int mousex, int mousey) { + final ItemStack hoverSlot = getStackMouseOver(mousex, mousey); + return hoverSlot != null ? getDraggedStackWithQuantity(hoverSlot) : null; + } + + @Override + public void mouseUp(int mousex, int mousey, int button) { + final ItemsGridSlot hoverSlot = getSlotMouseOver(mousex, mousey); + + if (hoverSlot != null && hoverSlot.itemIndex == this.mouseDownItemIndex + && ItemPanels.itemPanel.draggedStack == null) { + + if (NEIController.manager.window instanceof GuiRecipe || NEIClientUtils.shiftKey() + || !NEIClientConfig.canCheatItem(hoverSlot.getItemStack())) { + + if (button == 0) { + GuiCraftingRecipe.openRecipeGui("item", hoverSlot.getItemStack().copy()); + } else if (button == 1) { + GuiUsageRecipe.openRecipeGui("item", hoverSlot.getItemStack().copy()); + } + + } else { + NEIClientUtils.cheatItem(getDraggedStackWithQuantity(hoverSlot.getItemStack()), button, -1); + } + + } + + this.mouseDownItemIndex = -1; + } + +} diff --git a/src/main/java/codechicken/nei/Button.java b/src/main/java/codechicken/nei/Button.java index d4af7908..6fc3f20c 100644 --- a/src/main/java/codechicken/nei/Button.java +++ b/src/main/java/codechicken/nei/Button.java @@ -15,7 +15,7 @@ public abstract class Button extends Widget { } public int contentWidth() { - return getRenderIcon() == null ? getStringWidth(label) : getRenderIcon().width; + return getRenderIcon() == null ? getStringWidth(getRenderLabel()) : getRenderIcon().width; } @Override diff --git a/src/main/java/codechicken/nei/ClientHandler.java b/src/main/java/codechicken/nei/ClientHandler.java index 761ba888..f5ba173f 100644 --- a/src/main/java/codechicken/nei/ClientHandler.java +++ b/src/main/java/codechicken/nei/ClientHandler.java @@ -147,6 +147,7 @@ public class ClientHandler { loadHeightHackHandlers(); loadHiddenHandlers(); loadEnableAutoFocus(); + loadGuiCraftablesBlacklist(); ItemInfo.preInit(); StackInfo.loadGuidFilters(); } @@ -208,8 +209,13 @@ public class ClientHandler { public static void loadEnableAutoFocus() { loadSettingsFile( "enableautofocus.cfg", - lines -> AutoFocusWidget.enableAutoFocusPrefixes = lines - .collect(Collectors.toCollection(ArrayList::new))); + lines -> AutoFocusWidget.enableAutoFocusPrefixes = lines.collect(Collectors.toList())); + } + + public static void loadGuiCraftablesBlacklist() { + loadSettingsFile( + "guicraftablesblacklist.cfg", + lines -> ItemCraftablesPanel.guiBlacklist = lines.collect(Collectors.toList())); } public static void loadHiddenItems() { diff --git a/src/main/java/codechicken/nei/ItemCraftablesPanel.java b/src/main/java/codechicken/nei/ItemCraftablesPanel.java new file mode 100644 index 00000000..51e8a51b --- /dev/null +++ b/src/main/java/codechicken/nei/ItemCraftablesPanel.java @@ -0,0 +1,289 @@ +package codechicken.nei; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.IntStream; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; + +import codechicken.lib.vec.Rectangle4i; +import codechicken.nei.ItemsGrid.ItemsGridSlot; +import codechicken.nei.ItemsGrid.MouseContext; +import codechicken.nei.NEIClientUtils.Alignment; +import codechicken.nei.recipe.AutoCraftingManager; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.ICraftingHandler; +import codechicken.nei.recipe.IRecipeHandler; +import codechicken.nei.recipe.Recipe; +import codechicken.nei.recipe.Recipe.RecipeId; +import codechicken.nei.recipe.RecipeInfo; +import codechicken.nei.recipe.StackInfo; +import codechicken.nei.util.ReadableNumberConverter; + +public class ItemCraftablesPanel + extends AbstractSubpanel> { + + public static class CraftablesGridSlot extends ItemsGridSlot { + + protected final long realAmount; + protected final boolean isFluidDisplay; + protected final RecipeId recipeId; + + public CraftablesGridSlot(int slotIndex, int itemIndex, ItemStack itemStack, RecipeId recipeId) { + super(slotIndex, itemIndex, itemStack); + this.realAmount = StackInfo.getAmount(itemStack); + this.isFluidDisplay = StackInfo.itemStackToNBT(itemStack).hasKey("gtFluidName"); + this.recipeId = recipeId; + } + + @Override + public RecipeId getRecipeId() { + return this.recipeId; + } + + @Override + public void afterDraw(Rectangle4i rect, M mouseContext) { + drawStackSize(rect); + } + + protected void drawStackSize(Rectangle4i rect) { + long stackSize = this.realAmount; + + if (stackSize > 1) { + final float panelFactor = (rect.w - 2) / (DEFAULT_SLOT_SIZE - 2); + String amountString = ""; + + if (stackSize < 10_000) { + amountString = String.valueOf(stackSize); + } else { + amountString = ReadableNumberConverter.INSTANCE.toWideReadableForm(stackSize); + } + + if (this.isFluidDisplay) { + amountString += "L"; + } + + NEIClientUtils.drawNEIOverlayText( + amountString, + new Rectangle4i(rect.x + 1, rect.y + 1, rect.w - 2, rect.h - 2), + panelFactor, + 0xFFFFFF, + true, + this.isFluidDisplay ? Alignment.BottomLeft : Alignment.BottomRight); + } + } + + } + + public static List guiBlacklist = new ArrayList<>(); + private final int MIN_DELAY = 600; + + private Map> identHandlers = new HashMap<>(); + private Map availableRecipes = new HashMap<>(); + + private GuiContainer lastGuiContainer = null; + private ItemStackAmount lastPlayerInventory = null; + private long lastPlayerInventorySync = 0; + + public ItemCraftablesPanel() { + this.grid = new ItemsGrid<>() { + + protected List gridMask; + + @Override + protected void onGridChanged() { + this.gridMask = null; + super.onGridChanged(); + } + + @Override + public List getMask() { + + if (this.gridMask == null) { + int maxSlotIndex = this.rows * this.columns; + final AtomicInteger slotIndex = new AtomicInteger(0); + final List gridMask = new ArrayList<>(); + this.realItems.clear(); + + if (!ItemCraftablesPanel.this.availableRecipes.isEmpty()) { + ItemCraftablesPanel.this.availableRecipes.entrySet().stream() + .sorted(Map.Entry.comparingByKey(ItemSorter.instance)).forEach(entry -> { + this.realItems.add(entry.getKey()); + gridMask.add( + new CraftablesGridSlot( + slotIndex.get(), + slotIndex.get(), + entry.getKey(), + entry.getValue())); + slotIndex.incrementAndGet(); + }); + + this.gridMask = gridMask.subList(0, Math.min(gridMask.size(), maxSlotIndex)); + } else { + this.gridMask = Collections.emptyList(); + } + } + + return this.gridMask; + } + + @Override + protected MouseContext getMouseContext(int mousex, int mousey) { + final ItemsGridSlot hovered = getSlotMouseOver(mousex, mousey); + + if (hovered != null) { + return new MouseContext( + hovered.slotIndex, + hovered.slotIndex / this.columns, + hovered.slotIndex % this.columns); + } + + return null; + } + + }; + } + + @Override + protected ItemStack getDraggedStackWithQuantity(ItemStack itemStack) { + return ItemQuantityField.prepareStackWithQuantity(itemStack, StackInfo.getAmount(itemStack)); + } + + @Override + public void draw(int mousex, int mousey) { + if (!this.availableRecipes.isEmpty()) { + super.draw(mousex, mousey); + } + } + + @Override + public int setPanelWidth(int width) { + if (getGuiContainer() != this.lastGuiContainer) updateCraftables(); + + final int columns = width / ItemsGrid.SLOT_SIZE; + final int useRows = NEIClientConfig.getIntSetting("inventory.craftables.useRows"); + final int rows = (int) Math.min(Math.ceil(this.availableRecipes.size() * 1f / columns), useRows); + + this.w = width; + this.h = 8 + ItemsGrid.SLOT_SIZE * Math.max(rows, 1); + + return rows; + } + + public void update() { + this.splittingLineColor = NEIClientConfig.getSetting("inventory.craftables.color").getHexValue(); + updateCraftables(); + super.update(); + } + + private void updateCraftables() { + + if (!NEIClientConfig.showCraftablesPanelWidget()) { + clearCraftables(); + } else if (this.lastPlayerInventory == null + || Math.abs(System.currentTimeMillis() - this.lastPlayerInventorySync) >= MIN_DELAY) { + final GuiContainer firstGui = getGuiContainer(); + this.lastPlayerInventorySync = System.currentTimeMillis(); + + if (firstGui != null && !ItemCraftablesPanel.guiBlacklist.contains(firstGui.getClass().getName())) { + final ItemStackAmount inv = AutoCraftingManager.getInventoryItems(firstGui); + + if (this.lastGuiContainer != (this.lastGuiContainer = firstGui) + || !inv.equals(this.lastPlayerInventory)) { + this.lastPlayerInventory = inv; + this.availableRecipes = generateCraftables(firstGui); + this.grid.onGridChanged(); + } + + } else { + clearCraftables(); + } + + } + + } + + private void clearCraftables() { + if (!this.availableRecipes.isEmpty()) { + this.availableRecipes = Collections.emptyMap(); + this.lastPlayerInventory = null; + this.grid.onGridChanged(); + } + } + + private GuiContainer getGuiContainer() { + final GuiContainer firstGui = NEIClientUtils.getGuiContainer(); + return (firstGui instanceof GuiRecipe gui) ? gui.firstGui : firstGui; + } + + private Map generateCraftables(GuiContainer firstGui) { + final List availableHandlers = getAvailableHandlers(firstGui); + final Map availableRecipes = new HashMap<>(); + + if (!availableHandlers.isEmpty()) { + final List invStacks = ItemCraftablesPanel.this.lastPlayerInventory.values(); + + for (IRecipeHandler handler : availableHandlers) { + availableRecipes.putAll(filterHandlerRecipes(handler, firstGui, invStacks)); + } + + } + + return availableRecipes; + } + + private List getAvailableHandlers(GuiContainer firstGui) { + final List availableHandlers = new ArrayList<>(); + + for (String ident : RecipeInfo.getOverlayHandlerIdents(firstGui)) { + availableHandlers.addAll(identHandlers.computeIfAbsent(ident, GuiCraftingRecipe::getCraftingHandlers)); + } + + return availableHandlers; + } + + private Map filterHandlerRecipes(IRecipeHandler handler, GuiContainer firstGui, + List invStacks) { + final Map availableRecipes = new HashMap<>(); + + IntStream.range(0, handler.numRecipes()).parallel().forEach(recipeIndex -> { + if (existsIngredients(firstGui, handler.getIngredientStacks(recipeIndex), invStacks)) { + final Recipe recipe = Recipe.of(handler, recipeIndex); + + if (!recipe.getResults().isEmpty()) { + synchronized (availableRecipes) { + availableRecipes.put(recipe.getResult(), recipe.getRecipeId()); + } + } + } + }); + + return availableRecipes; + } + + private boolean existsIngredients(GuiContainer firstGui, List ingredients, + List invStacks) { + final Map usedItems = new HashMap<>(); + + for (PositionedStack pStack : ingredients) { + final ItemStack used = invStacks.stream().filter( + is -> usedItems.getOrDefault(is, is.stackSize) >= pStack.item.stackSize && pStack.contains(is)) + .findAny().orElse(null); + + if (used != null) { + usedItems.put(used, usedItems.getOrDefault(used, used.stackSize) - pStack.item.stackSize); + } else { + return false; + } + } + + return !usedItems.isEmpty(); + } + +} diff --git a/src/main/java/codechicken/nei/ItemHistoryPanel.java b/src/main/java/codechicken/nei/ItemHistoryPanel.java index 2c0261fb..f0534024 100644 --- a/src/main/java/codechicken/nei/ItemHistoryPanel.java +++ b/src/main/java/codechicken/nei/ItemHistoryPanel.java @@ -3,85 +3,89 @@ package codechicken.nei; import java.util.ArrayList; import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.ItemsGrid.ItemsGridSlot; import codechicken.nei.ItemsGrid.MouseContext; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.StackInfo; -public class ItemHistoryPanel extends Widget implements IContainerTooltipHandler { +public class ItemHistoryPanel extends AbstractSubpanel> { - protected int mouseDownItemIndex = -1; + public ItemHistoryPanel() { + this.grid = new ItemsGrid<>() { - protected ItemsGrid grid = new ItemsGrid<>() { + protected List gridMask; - protected List gridMask; + @Override + protected void onGridChanged() { + this.gridMask = null; + super.onGridChanged(); + } - @Override - protected void onGridChanged() { - this.gridMask = null; - super.onGridChanged(); - } + @Override + public List getMask() { - @Override - public List getMask() { - - if (this.gridMask == null) { - this.gridMask = new ArrayList<>(); - for (int slotIndex = 0; slotIndex < Math.min(size(), this.rows * this.columns); slotIndex++) { - this.gridMask.add(new ItemsGridSlot(slotIndex, slotIndex, getItem(slotIndex))); + if (this.gridMask == null) { + this.gridMask = new ArrayList<>(); + for (int slotIndex = 0; slotIndex < Math.min(size(), this.rows * this.columns); slotIndex++) { + this.gridMask.add(new ItemsGridSlot(slotIndex, slotIndex, getItem(slotIndex))); + } } + + return this.gridMask; } - return this.gridMask; - } + @Override + protected MouseContext getMouseContext(int mousex, int mousey) { + final ItemsGridSlot hovered = getSlotMouseOver(mousex, mousey); - @Override - protected MouseContext getMouseContext(int mousex, int mousey) { - final ItemsGridSlot hovered = getSlotMouseOver(mousex, mousey); + if (hovered != null) { + return new MouseContext( + hovered.slotIndex, + hovered.slotIndex / this.columns, + hovered.slotIndex % this.columns); + } - if (hovered != null) { - return new MouseContext( - hovered.slotIndex, - hovered.slotIndex / this.columns, - hovered.slotIndex % this.columns); + return null; } - return null; - } - - }; - - public boolean isEmpty() { - return grid.isEmpty(); + }; } + @Override + protected ItemStack getDraggedStackWithQuantity(ItemStack itemStack) { + return ItemQuantityField.prepareStackWithQuantity(itemStack, 0); + } + + @Override public void draw(int mousex, int mousey) { - - if (NEIClientConfig.getIntSetting("inventory.history.splittingMode") == 0) { - GuiDraw.drawRect(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue()); - } else { - drawSplittingArea(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue()); + if (this.grid.size() > 0) { + super.draw(mousex, mousey); } + } - this.grid.draw(mousex, mousey); + @Override + public int setPanelWidth(int width) { + final int columns = width / ItemsGrid.SLOT_SIZE; + final int useRows = NEIClientConfig.getIntSetting("inventory.history.useRows"); + final int rows = (int) Math.min(Math.ceil(this.grid.size() * 1f / columns), useRows); + + System.out.println("rows: " + rows + " " + columns + " " + this.grid.size() + " " + width); + + this.w = width; + this.h = 8 + ItemsGrid.SLOT_SIZE * Math.max(rows, 1); + + return rows; } public void update() { - this.grid.update(); + this.splittingLineColor = NEIClientConfig.getSetting("inventory.history.color").getHexValue(); + super.update(); } public void addItem(ItemStack stack) { if (stack != null) { - ItemStack is = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack), 0); + ItemStack is = StackInfo.withAmount(stack, 0); this.grid.realItems.removeIf(historyStack -> StackInfo.equalItemAndNBT(historyStack, stack, true)); this.grid.realItems.add(0, is); @@ -94,124 +98,4 @@ public class ItemHistoryPanel extends Widget implements IContainerTooltipHandler } } - public void resize(GuiContainer gui) { - this.grid.setGridSize(x, y + 4, w, h - 8); - this.grid.refresh(gui); - } - - @Override - public ItemStack getStackMouseOver(int mousex, int mousey) { - final ItemsGridSlot slot = getSlotMouseOver(mousex, mousey); - return slot == null ? null : slot.getItemStack(); - } - - public ItemsGridSlot getSlotMouseOver(int mousex, int mousey) { - return grid.getSlotMouseOver(mousex, mousey); - } - - private void drawSplittingArea(int x, int y, int width, int height, int color) { - - float alpha = (color >> 24 & 255) / 255.0F; - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - - GL11.glPushMatrix(); - - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_LINE_STIPPLE); - GL11.glColor4f(red, green, blue, alpha); - GL11.glLineWidth(2F); - GL11.glLineStipple(2, (short) 0x00FF); - - GL11.glBegin(GL11.GL_LINE_LOOP); - - GL11.glVertex2i(x, y); - GL11.glVertex2i(x + width, y); - GL11.glVertex2i(x + width, y + height); - GL11.glVertex2i(x, y + height); - - GL11.glEnd(); - - GL11.glLineStipple(1, (short) 0xFFFF); - GL11.glLineWidth(1F); - GL11.glDisable(GL11.GL_LINE_STIPPLE); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glColor4f(1F, 1F, 1F, 1F); - - GL11.glPopMatrix(); - - } - - @Override - public void mouseDragged(int mousex, int mousey, int button, long heldTime) { - - if (this.mouseDownItemIndex >= 0 && ItemPanels.itemPanel.draggedStack == null - && NEIClientUtils.getHeldItem() == null - && NEIClientConfig.hasSMPCounterPart()) { - - final ItemsGridSlot mouseOverSlot = getSlotMouseOver(mousex, mousey); - - if (mouseOverSlot == null || mouseOverSlot.itemIndex != this.mouseDownItemIndex || heldTime > 500) { - ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity( - this.grid.getItem(this.mouseDownItemIndex)); - this.mouseDownItemIndex = -1; - } - } - - } - - @Override - public boolean handleClick(int mousex, int mousey, int button) { - if (handleClickExt(mousex, mousey, button)) return true; - - final ItemsGridSlot hoverSlot = this.grid.getSlotMouseOver(mousex, mousey); - if (hoverSlot != null) { - - if (button == 2) { - ItemPanels.itemPanel.draggedStack = getDraggedStackWithQuantity(hoverSlot.getItemStack()); - } else { - mouseDownItemIndex = hoverSlot.itemIndex; - } - - return true; - } - - return false; - } - - protected ItemStack getDraggedStackWithQuantity(ItemStack itemStack) { - return ItemQuantityField.prepareStackWithQuantity(itemStack, 0); - } - - public ItemStack getStackMouseOverWithQuantity(int mousex, int mousey) { - final ItemStack hoverSlot = getStackMouseOver(mousex, mousey); - return hoverSlot != null ? getDraggedStackWithQuantity(hoverSlot) : null; - } - - @Override - public void mouseUp(int mousex, int mousey, int button) { - final ItemsGridSlot hoverSlot = getSlotMouseOver(mousex, mousey); - - if (hoverSlot != null && hoverSlot.itemIndex == this.mouseDownItemIndex - && ItemPanels.itemPanel.draggedStack == null) { - - if (NEIController.manager.window instanceof GuiRecipe || NEIClientUtils.shiftKey() - || !NEIClientConfig.canCheatItem(hoverSlot.getItemStack())) { - - if (button == 0) { - GuiCraftingRecipe.openRecipeGui("item", hoverSlot.getItemStack().copy()); - } else if (button == 1) { - GuiUsageRecipe.openRecipeGui("item", hoverSlot.getItemStack().copy()); - } - - } else { - NEIClientUtils.cheatItem(getDraggedStackWithQuantity(hoverSlot.getItemStack()), button, -1); - } - - } - - this.mouseDownItemIndex = -1; - } - } diff --git a/src/main/java/codechicken/nei/ItemPanel.java b/src/main/java/codechicken/nei/ItemPanel.java index f3f6dce4..8450fd5d 100644 --- a/src/main/java/codechicken/nei/ItemPanel.java +++ b/src/main/java/codechicken/nei/ItemPanel.java @@ -32,7 +32,8 @@ public class ItemPanel extends PanelWidget { } public ItemHistoryPanel historyPanel = new ItemHistoryPanel(); - public Button toggleGroups; + public ItemCraftablesPanel craftablesPanel = new ItemCraftablesPanel(); + protected Button toggleGroups; @Deprecated public static class ItemPanelSlot extends ItemsPanelGridSlot { @@ -83,6 +84,11 @@ public class ItemPanel extends PanelWidget { toggleGroups = new Button("G") { + @Override + public String getRenderLabel() { + return NEIClientUtils.translate("itempanel.collapsed.button"); + } + @Override public String getButtonTip() { return NEIClientUtils.translate("itempanel.collapsed.button.tip"); @@ -141,26 +147,38 @@ public class ItemPanel extends PanelWidget { } protected int resizeFooter(GuiContainer gui) { - if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered() - && !NEIClientConfig.showHistoryPanelWidget()) { + int footerY = y + h; + int footerHeight = 0; + + if (grid.getPerPage() == 0) { return 0; } + if (NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) { + footerY = LayoutManager.quantity.y; + footerHeight = LayoutManager.quantity.h + PanelWidget.PADDING; + } + if (NEIClientConfig.showHistoryPanelWidget()) { historyPanel.x = x; - historyPanel.w = w; - historyPanel.h = 8 + ItemsGrid.SLOT_SIZE * NEIClientConfig.getIntSetting("inventory.history.useRows"); - if (NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) { - historyPanel.y = LayoutManager.quantity.y - historyPanel.h - PanelWidget.PADDING; - return LayoutManager.quantity.h + historyPanel.h + PanelWidget.PADDING * 2; - } else { - historyPanel.y = y + h - historyPanel.h; - return historyPanel.h + PanelWidget.PADDING; + if (historyPanel.setPanelWidth(w) != 0) { + footerY = historyPanel.y = footerY - historyPanel.h; + footerHeight += historyPanel.h; + } + + } + + if (NEIClientConfig.showCraftablesPanelWidget()) { + craftablesPanel.x = x; + + if (craftablesPanel.setPanelWidth(w) != 0) { + footerY = craftablesPanel.y = footerY - craftablesPanel.h; + footerHeight += craftablesPanel.h; } } - return LayoutManager.quantity.h + PanelWidget.PADDING; + return footerHeight; } @Override @@ -168,20 +186,27 @@ public class ItemPanel extends PanelWidget { super.setVisible(); if (grid.getPerPage() > 0) { + if (!CollapsibleItems.isEmpty() && !grid.isEmpty()) { LayoutManager.addWidget(toggleGroups); } - if (NEIClientConfig.showHistoryPanelWidget() && (!grid.isEmpty() || !historyPanel.isEmpty())) { + if (NEIClientConfig.showCraftablesPanelWidget()) { + LayoutManager.addWidget(craftablesPanel); + } + + if (NEIClientConfig.showHistoryPanelWidget()) { LayoutManager.addWidget(historyPanel); } + } } @Override public void resize(GuiContainer gui) { super.resize(gui); - historyPanel.resize(gui); + this.historyPanel.resize(gui); + this.craftablesPanel.resize(gui); } protected ItemStack getDraggedStackWithQuantity(ItemStack itemStack) { diff --git a/src/main/java/codechicken/nei/ItemStackAmount.java b/src/main/java/codechicken/nei/ItemStackAmount.java index 0fff933c..37a774bd 100644 --- a/src/main/java/codechicken/nei/ItemStackAmount.java +++ b/src/main/java/codechicken/nei/ItemStackAmount.java @@ -104,6 +104,16 @@ public class ItemStackAmount { return this.itemMap.isEmpty(); } + @Override + public boolean equals(Object obj) { + + if (obj instanceof ItemStackAmount items) { + return this.itemMap.equals(items.itemMap); + } + + return false; + } + public static ItemStackAmount of(ItemStackAmount map) { ItemStackAmount result = new ItemStackAmount(); result.itemMap.putAll(map.itemMap); diff --git a/src/main/java/codechicken/nei/ItemsGrid.java b/src/main/java/codechicken/nei/ItemsGrid.java index 9b440af6..b0aaf58d 100644 --- a/src/main/java/codechicken/nei/ItemsGrid.java +++ b/src/main/java/codechicken/nei/ItemsGrid.java @@ -20,6 +20,7 @@ import org.lwjgl.opengl.GL30; import codechicken.lib.vec.Rectangle4i; import codechicken.nei.api.GuiInfo; import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.recipe.Recipe.RecipeId; import codechicken.nei.recipe.StackInfo; public abstract class ItemsGrid { @@ -171,6 +172,10 @@ public abstract class ItemsGrid void afterDraw(Rectangle4i rect, M mouseContext) {} + public RecipeId getRecipeId() { + return null; + } + public void drawItem(Rectangle4i rect) { drawItem(getItemStack(), rect); } diff --git a/src/main/java/codechicken/nei/ItemsPanelGrid.java b/src/main/java/codechicken/nei/ItemsPanelGrid.java index 90a79f4b..0139af0f 100644 --- a/src/main/java/codechicken/nei/ItemsPanelGrid.java +++ b/src/main/java/codechicken/nei/ItemsPanelGrid.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack; import codechicken.lib.vec.Rectangle4i; import codechicken.nei.ItemsGrid.ItemsGridSlot; import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.recipe.Recipe.RecipeId; public class ItemsPanelGrid extends ItemsGrid { @@ -37,6 +38,11 @@ public class ItemsPanelGrid extends ItemsGrid { - final List permutations = ingr.getPermutations(); - for (int index = 0; index < permutations.size(); index++) { - if (FavoriteRecipes.contains(permutations.get(index))) { - ingr.setActiveIndex(index); - break; - } - } - }); + if (useFavorites) { + ItemsGridSlot itemSlot = ItemPanels.itemPanel.getSlotMouseOver(mousex, mousey); + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.historyPanel.getSlotMouseOver(mousex, mousey); } - } else if (gui instanceof GuiRecipe guiRecipe) { + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.craftablesPanel.getSlotMouseOver(mousex, mousey); + } + + if (itemSlot != null) { + final RecipeId recipeId = itemSlot.getRecipeId(); + + if (recipeId != null && (recipe = Recipe.of(recipeId)) != null) { + + recipe.getIngredients().stream().forEach(ingr -> { + final List permutations = ingr.getPermutations(); + for (int index = 0; index < permutations.size(); index++) { + if (FavoriteRecipes.contains(permutations.get(index))) { + ingr.setActiveIndex(index); + break; + } + } + }); + + } + + } + } + + if (gui instanceof GuiRecipe guiRecipe) { recipe = guiRecipe.getFocusedRecipe(); } @@ -508,17 +522,29 @@ public abstract class ShortcutInputHandler { if (slot != null) { return slot.isIngredient() ? null : slot.getRecipeId(); - } else if (ItemPanels.itemPanel.contains(mousex, mousey) - || ItemPanels.itemPanel.historyPanel.contains(mousex, mousey)) { - return FavoriteRecipes.getFavorite(stack); - } else - if (gui instanceof GuiRecipe guiRecipe) { - final Recipe focusedRecipe = guiRecipe.getFocusedRecipe(); + } - if (focusedRecipe != null) { - return focusedRecipe.getRecipeId(); - } + ItemsGridSlot itemSlot = ItemPanels.itemPanel.getSlotMouseOver(mousex, mousey); + + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.historyPanel.getSlotMouseOver(mousex, mousey); + } + + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.craftablesPanel.getSlotMouseOver(mousex, mousey); + } + + if (itemSlot != null) { + return itemSlot.getRecipeId(); + } + + if (gui instanceof GuiRecipe guiRecipe) { + final Recipe focusedRecipe = guiRecipe.getFocusedRecipe(); + + if (focusedRecipe != null) { + return focusedRecipe.getRecipeId(); } + } return null; } diff --git a/src/main/java/codechicken/nei/bookmark/BookmarksGridSlot.java b/src/main/java/codechicken/nei/bookmark/BookmarksGridSlot.java index c9ef5b6f..4203a663 100644 --- a/src/main/java/codechicken/nei/bookmark/BookmarksGridSlot.java +++ b/src/main/java/codechicken/nei/bookmark/BookmarksGridSlot.java @@ -105,6 +105,7 @@ public class BookmarksGridSlot extends ItemsGridSlot { return this.bookmarkItem; } + @Override public RecipeId getRecipeId() { return this.bookmarkItem.recipeId; } diff --git a/src/main/java/codechicken/nei/recipe/GuiCraftingRecipe.java b/src/main/java/codechicken/nei/recipe/GuiCraftingRecipe.java index 62d5e62a..cfe8963a 100644 --- a/src/main/java/codechicken/nei/recipe/GuiCraftingRecipe.java +++ b/src/main/java/codechicken/nei/recipe/GuiCraftingRecipe.java @@ -13,8 +13,8 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.item.ItemStack; import codechicken.lib.gui.GuiDraw; -import codechicken.nei.FavoriteRecipes; import codechicken.nei.ItemPanels; +import codechicken.nei.ItemsGrid.ItemsGridSlot; import codechicken.nei.NEIClientConfig; import codechicken.nei.NEIClientUtils; import codechicken.nei.bookmark.BookmarksGridSlot; @@ -52,6 +52,12 @@ public class GuiCraftingRecipe extends GuiRecipe { final GuiCraftingRecipe gui = new GuiCraftingRecipe(handlers, "recipeId".equals(outputId)); if (open) { + + if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(outputId) + && results[0] instanceof ItemStack stack) { + ItemPanels.itemPanel.historyPanel.addItem(stack); + } + mc.displayGuiScreen(gui); } @@ -123,8 +129,18 @@ public class GuiCraftingRecipe extends GuiRecipe { recipeId = panelSlot.getRecipeId(); } - if (recipeId == null) { - recipeId = FavoriteRecipes.getFavorite(stackover); + ItemsGridSlot itemSlot = ItemPanels.itemPanel.getSlotMouseOver(mouseover.x, mouseover.y); + + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.historyPanel.getSlotMouseOver(mouseover.x, mouseover.y); + } + + if (itemSlot == null) { + itemSlot = ItemPanels.itemPanel.craftablesPanel.getSlotMouseOver(mouseover.x, mouseover.y); + } + + if (itemSlot != null) { + return itemSlot.getRecipeId(); } return recipeId; diff --git a/src/main/java/codechicken/nei/recipe/GuiUsageRecipe.java b/src/main/java/codechicken/nei/recipe/GuiUsageRecipe.java index 366960b9..de27c077 100644 --- a/src/main/java/codechicken/nei/recipe/GuiUsageRecipe.java +++ b/src/main/java/codechicken/nei/recipe/GuiUsageRecipe.java @@ -8,6 +8,7 @@ import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; +import codechicken.nei.ItemPanels; import codechicken.nei.NEIClientConfig; import codechicken.nei.NEIClientUtils; import codechicken.nei.recipe.Recipe.RecipeId; @@ -34,6 +35,11 @@ public class GuiUsageRecipe extends GuiRecipe { final RecipeId recipeId = getCurrentRecipeId(mc.currentScreen); final GuiUsageRecipe gui = new GuiUsageRecipe(handlers); + if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(inputId) + && ingredients[0] instanceof ItemStack stack) { + ItemPanels.itemPanel.historyPanel.addItem(stack); + } + mc.displayGuiScreen(gui); gui.openTargetRecipe(recipeId); return true; @@ -51,8 +57,8 @@ public class GuiUsageRecipe extends GuiRecipe { final RecipeHandlerQuery recipeQuery = new RecipeHandlerQuery<>( h -> getUsageOrCatalystHandler(h, inputId, ingredients), - usagehandlers, - serialUsageHandlers, + GuiUsageRecipe.usagehandlers, + GuiUsageRecipe.serialUsageHandlers, "Error while looking up usage recipe", "inputId: " + inputId, "ingredients: " + Arrays.toString(ingredients)); diff --git a/src/main/java/codechicken/nei/recipe/ItemsHistoryHandler.java b/src/main/java/codechicken/nei/recipe/ItemsHistoryHandler.java deleted file mode 100644 index dea1b7ad..00000000 --- a/src/main/java/codechicken/nei/recipe/ItemsHistoryHandler.java +++ /dev/null @@ -1,119 +0,0 @@ -package codechicken.nei.recipe; - -import java.util.List; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; - -import codechicken.nei.ItemPanels; -import codechicken.nei.NEIClientConfig; -import codechicken.nei.PositionedStack; -import codechicken.nei.api.IOverlayHandler; -import codechicken.nei.api.IRecipeOverlayRenderer; - -class ItemsHistoryHandler implements ICraftingHandler, IUsageHandler { - - @Override - public ICraftingHandler getRecipeHandler(String outputId, Object... results) { - - if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(outputId) - && results[0] instanceof ItemStack stack) { - ItemPanels.itemPanel.historyPanel.addItem(stack); - } - - return null; - } - - @Override - public IUsageHandler getUsageHandler(String inputId, Object... ingredients) { - - if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(inputId) - && ingredients[0] instanceof ItemStack stack) { - ItemPanels.itemPanel.historyPanel.addItem(stack); - } - - return null; - } - - @Override - public void onUpdate() { - - } - - @Override - public boolean hasOverlay(GuiContainer gui, Container container, int recipe) { - return false; - } - - @Override - public IRecipeOverlayRenderer getOverlayRenderer(GuiContainer gui, int recipe) { - return null; - } - - @Override - public IOverlayHandler getOverlayHandler(GuiContainer gui, int recipe) { - return null; - } - - @Override - public int recipiesPerPage() { - return 0; - } - - @Override - public List handleTooltip(GuiRecipe gui, List currenttip, int recipe) { - return null; - } - - @Override - public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currenttip, int recipe) { - return null; - } - - @Override - public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) { - return false; - } - - @Override - public boolean mouseClicked(GuiRecipe gui, int button, int recipe) { - return true; - } - - @Override - public String getRecipeName() { - return "Items History"; - } - - @Override - public int numRecipes() { - return 0; - } - - @Override - public void drawBackground(int recipe) { - - } - - @Override - public void drawForeground(int recipe) { - - } - - @Override - public List getIngredientStacks(int recipe) { - return null; - } - - @Override - public List getOtherStacks(int recipeType) { - return null; - } - - @Override - public PositionedStack getResultStack(int recipe) { - return null; - } - -} diff --git a/src/main/java/codechicken/nei/recipe/RecipeInfo.java b/src/main/java/codechicken/nei/recipe/RecipeInfo.java index c1c33020..1515ae17 100644 --- a/src/main/java/codechicken/nei/recipe/RecipeInfo.java +++ b/src/main/java/codechicken/nei/recipe/RecipeInfo.java @@ -1,6 +1,8 @@ package codechicken.nei.recipe; import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; import net.minecraft.client.gui.inventory.GuiBrewingStand; import net.minecraft.client.gui.inventory.GuiContainer; @@ -79,6 +81,12 @@ public class RecipeInfo { return overlayMap.get(new OverlayKey(gui.getClass(), ident)); } + public static List getOverlayHandlerIdents(GuiContainer gui) { + final Class classz = gui.getClass(); + return overlayMap.keySet().stream().filter(key -> key.ident != null && key.guiClass.equals(classz)) + .map(key -> key.ident).collect(Collectors.toList()); + } + public static IStackPositioner getStackPositioner(GuiContainer gui, String ident) { return positionerMap.get(new OverlayKey(gui.getClass(), ident)); } @@ -116,7 +124,5 @@ public class RecipeInfo { API.registerRecipeHandler(new ProfilerRecipeHandler(true)); API.registerUsageHandler(new ProfilerRecipeHandler(false)); - API.registerRecipeHandler(new ItemsHistoryHandler()); - API.registerUsageHandler(new ItemsHistoryHandler()); } } diff --git a/src/main/java/codechicken/nei/recipe/RecipeItemInputHandler.java b/src/main/java/codechicken/nei/recipe/RecipeItemInputHandler.java index 5072537c..9301d640 100644 --- a/src/main/java/codechicken/nei/recipe/RecipeItemInputHandler.java +++ b/src/main/java/codechicken/nei/recipe/RecipeItemInputHandler.java @@ -11,6 +11,7 @@ import codechicken.lib.vec.Rectangle4i; import codechicken.nei.BookmarkPanel.BookmarkViewMode; import codechicken.nei.FavoriteRecipes; import codechicken.nei.ItemPanels; +import codechicken.nei.ItemsGrid.ItemsGridSlot; import codechicken.nei.NEIClientConfig; import codechicken.nei.api.ShortcutInputHandler; import codechicken.nei.bookmark.BookmarksGridSlot; @@ -100,9 +101,20 @@ public class RecipeItemInputHandler implements IContainerInputHandler, IContaine return null; } - if (ItemPanels.itemPanel.contains(mousex, mousey) - || ItemPanels.itemPanel.historyPanel.contains(mousex, mousey)) { - return NEIClientConfig.showRecipeTooltipInPanel() ? FavoriteRecipes.getFavorite(itemstack) : null; + if (NEIClientConfig.showRecipeTooltipInPanel()) { + ItemsGridSlot panelSlot = ItemPanels.itemPanel.getSlotMouseOver(mousex, mousey); + + if (panelSlot == null) { + panelSlot = ItemPanels.itemPanel.historyPanel.getSlotMouseOver(mousex, mousey); + } + + if (panelSlot == null) { + panelSlot = ItemPanels.itemPanel.craftablesPanel.getSlotMouseOver(mousex, mousey); + } + + if (panelSlot != null) { + return panelSlot.getRecipeId(); + } } if (gui instanceof GuiRecipeguiRecipe diff --git a/src/main/java/codechicken/nei/recipe/ShapedRecipeHandler.java b/src/main/java/codechicken/nei/recipe/ShapedRecipeHandler.java index 73b41f07..99d33bed 100644 --- a/src/main/java/codechicken/nei/recipe/ShapedRecipeHandler.java +++ b/src/main/java/codechicken/nei/recipe/ShapedRecipeHandler.java @@ -86,13 +86,27 @@ public class ShapedRecipeHandler extends TemplateRecipeHandler { if (outputId.equals("crafting") && getClass() == ShapedRecipeHandler.class) { for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { CachedShapedRecipe recipe = null; - if (irecipe instanceof ShapedRecipes) recipe = new CachedShapedRecipe((ShapedRecipes) irecipe); - else if (irecipe instanceof ShapedOreRecipe) recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe); - if (recipe == null) continue; + if (irecipe instanceof ShapedRecipes shaped) { + recipe = new CachedShapedRecipe(shaped); + } else if (irecipe instanceof ShapedOreRecipe shaped) { + recipe = forgeShapedRecipe(shaped); + } + + if (recipe != null) { + recipe.computeVisuals(); + arecipes.add(recipe); + } + } + } else if (outputId.equals("crafting2x2") && getClass() == ShapedRecipeHandler.class) { + for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { + + if (irecipe instanceof ShapedRecipes shaped && shaped.recipeWidth <= 2 && shaped.recipeHeight <= 2) { + CachedShapedRecipe recipe = new CachedShapedRecipe(shaped); + recipe.computeVisuals(); + arecipes.add(recipe); + } - recipe.computeVisuals(); - arecipes.add(recipe); } } else { super.loadCraftingRecipes(outputId, results); diff --git a/src/main/java/codechicken/nei/recipe/ShapelessRecipeHandler.java b/src/main/java/codechicken/nei/recipe/ShapelessRecipeHandler.java index 195d632d..01e6dded 100644 --- a/src/main/java/codechicken/nei/recipe/ShapelessRecipeHandler.java +++ b/src/main/java/codechicken/nei/recipe/ShapelessRecipeHandler.java @@ -86,13 +86,31 @@ public class ShapelessRecipeHandler extends ShapedRecipeHandler { List allrecipes = CraftingManager.getInstance().getRecipeList(); for (IRecipe irecipe : allrecipes) { CachedShapelessRecipe recipe = null; - if (irecipe instanceof ShapelessRecipes) recipe = shapelessRecipe((ShapelessRecipes) irecipe); - else if (irecipe instanceof ShapelessOreRecipe) - recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe); - if (recipe == null) continue; + if (irecipe instanceof ShapelessRecipes shapeless) { + recipe = shapelessRecipe(shapeless); + } else if (irecipe instanceof ShapelessOreRecipe shapeless) { + recipe = forgeShapelessRecipe(shapeless); + } - arecipes.add(recipe); + if (recipe != null) { + arecipes.add(recipe); + } + } + } else if (outputId.equals("crafting2x2") && getClass() == ShapelessRecipeHandler.class) { + List allrecipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe irecipe : allrecipes) { + CachedShapelessRecipe recipe = null; + + if (irecipe instanceof ShapelessRecipes shapeless && shapeless.getRecipeSize() <= 4) { + recipe = shapelessRecipe(shapeless); + } else if (irecipe instanceof ShapelessOreRecipe shapeless && shapeless.getRecipeSize() <= 4) { + recipe = forgeShapelessRecipe(shapeless); + } + + if (recipe != null) { + arecipes.add(recipe); + } } } else { super.loadCraftingRecipes(outputId, results); diff --git a/src/main/resources/assets/nei/cfg/guicraftablesblacklist.cfg b/src/main/resources/assets/nei/cfg/guicraftablesblacklist.cfg new file mode 100644 index 00000000..70b20c7c --- /dev/null +++ b/src/main/resources/assets/nei/cfg/guicraftablesblacklist.cfg @@ -0,0 +1,8 @@ +# Each line in this file should either be a comment (line starts with '#'), handler name or handler id. +# If you delete this file, it will be regenerated with the default handlers list. +appeng.client.gui.implementations.GuiPatternTerm +appeng.client.gui.implementations.GuiPatternTermEx +com.glodblock.github.client.gui.GuiFluidPatternExWireless +com.glodblock.github.client.gui.GuiFluidPatternTerminal +com.glodblock.github.client.gui.GuiFluidPatternTerminalEx +com.glodblock.github.client.gui.GuiFluidPatternWireless \ No newline at end of file diff --git a/src/main/resources/assets/nei/lang/en_US.lang b/src/main/resources/assets/nei/lang/en_US.lang index eb1a49cb..2c0c9750 100644 --- a/src/main/resources/assets/nei/lang/en_US.lang +++ b/src/main/resources/assets/nei/lang/en_US.lang @@ -51,6 +51,7 @@ nei.inventory.search.placeholder=Search... nei.itempanel.quantity.default=One stack nei.itempanel.loading=Loading Item List... nei.itempanel.deleteItem=Delete Item +nei.itempanel.collapsed.button=G nei.itempanel.collapsed.button.tip=Collapse/Expand All Collapsible Items nei.itempanel.collapsed.hint.expand=Expand Group (%d items) nei.itempanel.collapsed.hint.collapse=Collapse Group (%d items) @@ -386,11 +387,14 @@ nei.options.inventory.history=History Panel nei.options.inventory.history.enabled=History Panel Visibility nei.options.inventory.history.enabled.true=Enabled nei.options.inventory.history.enabled.false=Disabled -nei.options.inventory.history.historyColor=Color +nei.options.inventory.history.color=Color nei.options.inventory.history.useRows=Rows -nei.options.inventory.history.splittingMode=Splitting Mode -nei.options.inventory.history.splittingMode.0=Background -nei.options.inventory.history.splittingMode.1=Dotted Line +nei.options.inventory.craftables=Craftables Panel +nei.options.inventory.craftables.enabled=Craftables Panel Visibility +nei.options.inventory.craftables.enabled.true=Enabled +nei.options.inventory.craftables.enabled.false=Disabled +nei.options.inventory.craftables.color=Color +nei.options.inventory.craftables.useRows=Rows nei.options.inventory.subsets=Subsets Widget nei.options.inventory.subsets.enabled=Subsets Visibility nei.options.inventory.subsets.enabled.true=Enabled diff --git a/src/main/resources/assets/nei/lang/ru_RU.lang b/src/main/resources/assets/nei/lang/ru_RU.lang index 54eb5d8b..dd01cc7b 100644 --- a/src/main/resources/assets/nei/lang/ru_RU.lang +++ b/src/main/resources/assets/nei/lang/ru_RU.lang @@ -28,6 +28,7 @@ nei.bookmark.crafting_chain.remainder=Остатки nei.itempanel.quantity.default=Одна стопка nei.itempanel.loading=Загрузка списка предметов... nei.itempanel.deleteItem=Удалить предмет +nei.itempanel.collapsed.button=Г nei.itempanel.collapsed.button.tip=Свернуть/Развернуть все группы предметов nei.itempanel.collapsed.hint.expand=Развернуть группу (%d предметов) nei.itempanel.collapsed.hint.collapse=Свернуть группу (%d предметов) @@ -301,11 +302,14 @@ nei.options.inventory.history=Панель истории nei.options.inventory.history.enabled=Видимость панели истории nei.options.inventory.history.enabled.true=Включено nei.options.inventory.history.enabled.false=Отключено -nei.options.inventory.history.historyColor=Цвет +nei.options.inventory.history.color=Цвет nei.options.inventory.history.useRows=Строки -nei.options.inventory.history.splittingMode=Режим разделения -nei.options.inventory.history.splittingMode.0=Фон -nei.options.inventory.history.splittingMode.1=Пунктирная линия +nei.options.inventory.craftables=Панель создания +nei.options.inventory.craftables.enabled=Видимость панели создания +nei.options.inventory.craftables.enabled.true=Включено +nei.options.inventory.craftables.enabled.false=Отключено +nei.options.inventory.craftables.color=Цвет +nei.options.inventory.craftables.useRows=Строки nei.options.inventory.itemzoom=Панель увеличения предметов nei.options.inventory.itemzoom.enabled=Видимость панели увеличения предметов nei.options.inventory.itemzoom.enabled.true=Включено diff --git a/src/main/resources/assets/nei/textures/dash.png b/src/main/resources/assets/nei/textures/dash.png new file mode 100644 index 00000000..39801437 Binary files /dev/null and b/src/main/resources/assets/nei/textures/dash.png differ