Return shift click insert into phantom slots (#1021)

This commit is contained in:
lc-1337 authored and GitHub committed 2026-01-17 09:35:22 +00:00
1 parent 080dc9b4da
commit f659f4b026
4 files changed
+33 -6

No files matched your search

@@ -600,6 +600,17 @@ public abstract class AEBaseGui extends GuiContainer implements IGuiTooltipHandl
}
}
if (slot != null && slot.getHasStack()) {
final ItemStack stack = slot.getStack();
for (VirtualMESlot vmeSlot : this.virtualSlots) {
if (vmeSlot instanceof VirtualMEPhantomSlot vmepSlot && vmepSlot.getAEStack() == null) {
vmepSlot.setShiftClickStack(stack.copy());
this.handlePhantomSlotInteraction(vmepSlot, mouseButton);
break;
}
}
}
this.disableShiftClick = false;
}
@@ -225,7 +225,7 @@ public class GuiStorageBus extends GuiUpgradeable {
protected void updateSlotVisibility() {
for (VirtualMEPhantomSlot slot : this.configSlots) {
slot.setHidden(
slot.getSlotIndex() > (18
slot.getSlotIndex() >= (18
+ (9 * this.containerStorageBus.getUpgradeable().getInstalledUpgrades(Upgrades.CAPACITY))));
}
}
@@ -1,5 +1,7 @@
package appeng.client.gui.slots;
import net.minecraft.item.ItemStack;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
@@ -26,4 +28,7 @@ public class VirtualMEPatternSlot extends VirtualMEPhantomSlot {
super.handleMouseClicked(acceptItem, acceptFluid, isExtraAction, mouseButton);
}
@Override
public void setShiftClickStack(ItemStack shiftClickStack) {}
}
@@ -22,6 +22,7 @@ import codechicken.nei.recipe.StackInfo;
public class VirtualMEPhantomSlot extends VirtualMESlot {
private final IAEStackInventory inventory;
private ItemStack shiftClickStack = null;
public VirtualMEPhantomSlot(int x, int y, IAEStackInventory inventory, int slotIndex) {
super(x, y, slotIndex);
@@ -94,12 +95,22 @@ public class VirtualMEPhantomSlot extends VirtualMESlot {
}
private ItemStack getTargetStack() {
ItemStack is = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
if (is == null && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI)) {
is = ItemPanels.bookmarkPanel.draggedStack;
if (is == null) is = ItemPanels.itemPanel.draggedStack;
if (this.shiftClickStack == null) {
ItemStack is = Minecraft.getMinecraft().thePlayer.inventory.getItemStack();
if (is == null && IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI)) {
is = ItemPanels.bookmarkPanel.draggedStack;
if (is == null) is = ItemPanels.itemPanel.draggedStack;
}
return is != null ? is.copy() : null;
}
return is != null ? is.copy() : null;
final ItemStack is = this.shiftClickStack;
this.shiftClickStack = null;
return is;
}
public void setShiftClickStack(ItemStack shiftClickStack) {
this.shiftClickStack = shiftClickStack;
}
}