From 12cc9428eef9aaa46b32368d422af6770a91fa2e Mon Sep 17 00:00:00 2001 From: ineternet <33813737+ineternet@users.noreply.github.com> Date: Tue, 9 Jan 2018 19:12:23 +0100 Subject: [PATCH] Changed item quantity of a craftable item to 0 (#1613) * Changed item quantity of a craftable item to 0 Whenever a system has none of a specific item but the ability to craft it, the grid saves the quantity as 1. Quantity sorting would make use of this and sort it alphabetically together with other quantity 1 items. This change should make quantity sorting think craftable items have a quantity of 0, making all of them appear behind itemstacks with the quantity 1 (or higher). * Moving code logic to GridStackItem * Update GridSortingQuantity.java * Changed stack quantity logic Craftable itemstacks remain stored as "1 item" internally. Other classes will be given the information that the stack is empty, though. * Update CHANGELOG.md --- CHANGELOG.md | 1 + .../refinedstorage/gui/grid/stack/GridStackItem.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ced1d9b2..0eb8867b4 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 1.5.32 - Added Spanish translation (Samuelrock) - Fixed issue where the Pattern Grid can only overwrite patterns when blank ones are present (ineternet) +- Changed stack quantity of craftable items from 1 to 0 to fix Quantity Sorting (ineternet) ### 1.5.31 - Improved the "cannot craft! loop in processing..." error message (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java index 952854314..765e9b014 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java @@ -114,7 +114,7 @@ public class GridStackItem implements IGridStack { @Override public int getQuantity() { - return stack.getCount(); + return doesDisplayCraftText() ? 0 : stack.getCount(); } @Override