Fix crafting plan reporting invisible extractable items as available
Closes #438
This commit is contained in:
@@ -31,7 +31,7 @@ import appeng.api.networking.crafting.ICraftingLink;
|
|||||||
import appeng.api.networking.security.IActionHost;
|
import appeng.api.networking.security.IActionHost;
|
||||||
import appeng.api.networking.security.IActionSource;
|
import appeng.api.networking.security.IActionSource;
|
||||||
import appeng.api.networking.storage.IStorageGrid;
|
import appeng.api.networking.storage.IStorageGrid;
|
||||||
import appeng.api.storage.IMEInventory;
|
import appeng.api.storage.IMEMonitor;
|
||||||
import appeng.api.storage.ITerminalHost;
|
import appeng.api.storage.ITerminalHost;
|
||||||
import appeng.api.storage.channels.IItemStorageChannel;
|
import appeng.api.storage.channels.IItemStorageChannel;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
@@ -213,12 +213,16 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
|||||||
p.setStackSize(out.getCountRequestable());
|
p.setStackSize(out.getCountRequestable());
|
||||||
|
|
||||||
final IStorageGrid sg = grid.getCache(IStorageGrid.class);
|
final IStorageGrid sg = grid.getCache(IStorageGrid.class);
|
||||||
final IMEInventory<IAEItemStack> items = sg.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
final IMEMonitor<IAEItemStack> items = sg.getInventory(AEApi.instance().storage().getStorageChannel(IItemStorageChannel.class));
|
||||||
|
|
||||||
IAEItemStack m = null;
|
IAEItemStack m = null;
|
||||||
if (c != null && this.result.isSimulation()) {
|
if (c != null && this.result.isSimulation()) {
|
||||||
m = o.copy();
|
m = o.copy();
|
||||||
o = items.extractItems(o, Actionable.SIMULATE, this.getActionSource());
|
if (items.getStorageList().findPrecise(o) != null) {
|
||||||
|
o = items.extractItems(o, Actionable.SIMULATE, this.getActionSource());
|
||||||
|
} else {
|
||||||
|
o = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
o = m.copy();
|
o = m.copy();
|
||||||
@@ -330,8 +334,7 @@ public class ContainerCraftConfirm extends AEBaseContainer {
|
|||||||
if (te != null) {
|
if (te != null) {
|
||||||
Platform.openGUI(this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui);
|
Platform.openGUI(this.getInventoryPlayer().player, te, this.getOpenContext().getSide(), originalGui);
|
||||||
} else {
|
} else {
|
||||||
if (ah instanceof IInventorySlotAware) {
|
if (ah instanceof IInventorySlotAware i) {
|
||||||
IInventorySlotAware i = ((IInventorySlotAware) ah);
|
|
||||||
Platform.openGUI(this.getInventoryPlayer().player, i.getInventorySlot(), originalGui, i.isBaubleSlot());
|
Platform.openGUI(this.getInventoryPlayer().player, i.getInventorySlot(), originalGui, i.isBaubleSlot());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user