|
1 | 1 | package gregtech.common.mui.widget.workbench;
|
2 | 2 |
|
| 3 | +import com.cleanroommc.modularui.integration.jei.JeiIngredientProvider; |
| 4 | + |
3 | 5 | import gregtech.api.util.GTLog;
|
4 | 6 | import gregtech.client.utils.RenderUtil;
|
5 | 7 | import gregtech.common.metatileentities.storage.CraftingRecipeLogic;
|
|
29 | 31 | import com.cleanroommc.modularui.widgets.slot.SlotGroup;
|
30 | 32 | import com.google.common.collect.Lists;
|
31 | 33 | import org.jetbrains.annotations.NotNull;
|
| 34 | +import org.jetbrains.annotations.Nullable; |
32 | 35 |
|
33 | 36 | import java.io.IOException;
|
34 | 37 | import java.util.ArrayList;
|
35 | 38 | import java.util.Comparator;
|
36 | 39 | import java.util.List;
|
37 | 40 | import java.util.stream.Collectors;
|
38 | 41 |
|
39 |
| -public class CraftingOutputSlot extends Widget<CraftingOutputSlot> implements Interactable { |
| 42 | +public class CraftingOutputSlot extends Widget<CraftingOutputSlot> implements Interactable, JeiIngredientProvider { |
40 | 43 |
|
41 | 44 | private final CraftingSlotSH syncHandler;
|
42 | 45 |
|
@@ -86,6 +89,11 @@ public void drawForeground(GuiContext context) {
|
86 | 89 | }
|
87 | 90 | }
|
88 | 91 |
|
| 92 | + @Override |
| 93 | + public @Nullable ItemStack getIngredient() { |
| 94 | + return this.syncHandler.getOutputStack(); |
| 95 | + } |
| 96 | + |
89 | 97 | protected static class CraftingSlotSH extends SyncHandler {
|
90 | 98 |
|
91 | 99 | private final CraftingRecipeLogic recipeLogic;
|
@@ -139,7 +147,10 @@ public void quickTransfer(ItemStack fromStack) {
|
139 | 147 | for (ModularSlot toSlot : this.shiftClickSlots) {
|
140 | 148 | if (toSlot.isEnabled() && toSlot.isItemValid(fromStack)) {
|
141 | 149 | ItemStack toStack = toSlot.getStack().copy();
|
142 |
| - if (toStack.isEmpty()) emptySlots.add(toSlot); |
| 150 | + if (toStack.isEmpty()) { |
| 151 | + emptySlots.add(toSlot); |
| 152 | + continue; |
| 153 | + } |
143 | 154 |
|
144 | 155 | if (ItemHandlerHelper.canItemStacksStack(fromStack, toStack)) {
|
145 | 156 | int j = toStack.getCount() + fromStack.getCount();
|
|
0 commit comments