This commit is contained in:
lc-1337 authored and GitHub committed 2026-02-09 08:25:43 +01:00
1 parent 0b58dc042d
commit 495b7bbe9e
5 files changed
+14 -10

No files matched your search

+10 -8
View File
@@ -452,13 +452,20 @@ public abstract class AEBaseGui extends GuiContainer implements IGuiTooltipHandl
return new Rectangle(guiLeft + slot.getX(), guiTop + slot.getY(), 16, 16);
}
private ItemStack getStackFromHand() {
final ItemStack phantom = IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI)
? NEI.instance.getDraggingPhantomItem()
: null;
return phantom != null ? phantom : this.mc.thePlayer.inventory.getItemStack();
}
protected boolean handleVirtualSlotClick(final VirtualMESlot slot, final int mouseButton) {
if (slot instanceof VirtualMEPhantomSlot vSlot) {
this.handlePhantomSlotInteraction(vSlot, mouseButton);
// Prevent double dragging
if (this.mc.thePlayer.inventory.getItemStack() != null
&& !this.draggedVirtualSlots.contains(this.hoveredVirtualSlot)) {
if (this.getStackFromHand() != null && !this.draggedVirtualSlots.contains(this.hoveredVirtualSlot)) {
this.draggedVirtualSlots.add(this.hoveredVirtualSlot);
}
}
@@ -473,12 +480,7 @@ public abstract class AEBaseGui extends GuiContainer implements IGuiTooltipHandl
}
private void handlePhantomSlotInteraction(VirtualMEPhantomSlot slot, int mouseButton) {
ItemStack phantom = IntegrationRegistry.INSTANCE.isEnabled(IntegrationType.NEI)
? NEI.instance.getDraggingPhantomItem()
: null;
ItemStack holding = phantom != null ? phantom : this.mc.thePlayer.inventory.getItemStack();
slot.handleMouseClicked(holding, isCtrlKeyDown(), mouseButton);
slot.handleMouseClicked(this.getStackFromHand(), isCtrlKeyDown(), mouseButton);
}
@Override
@@ -523,7 +523,6 @@ public class ContainerMEMonitorable extends AEBaseContainer
pinsHandler.addItemsToPins(craftedItems);
}
pinsHandler.update(forceUpdate);
onListUpdate(); // notify the repo that the pins have changed
}
@Override
@@ -976,8 +975,8 @@ public class ContainerMEMonitorable extends AEBaseContainer
Actionable.MODULATE,
this.getActionSource());
aes.setStackSize(amountBeforeExtract - filledAmount);
if (aes.getStackSize() <= 0) break;
hand.stackSize--;
if (aes.getStackSize() <= 0) break;
}
this.updateHeld(player);
}
@@ -85,6 +85,8 @@ public class FluidUtils {
public static ObjectLongPair<ItemStack> fillFluidContainer(@Nullable ItemStack itemStack, FluidStack fluidStack) {
if (itemStack == null) return new ObjectLongImmutablePair<>(null, 0);
itemStack.stackSize = 1;
if (itemStack.getItem() instanceof IFluidContainerItem container) {
return new ObjectLongImmutablePair<>(itemStack, container.fill(itemStack, fluidStack, true));
} else if (FluidContainerRegistry.isContainer(itemStack)) {
@@ -101,6 +101,7 @@ public class AEFluidStackType implements IAEStackType<IAEFluidStack> {
@Override
public @NotNull ObjectLongPair<ItemStack> drainStackFromContainer(@NotNull ItemStack itemStack,
@NotNull IAEFluidStack stack) {
itemStack.stackSize = 1;
if (itemStack.getItem() instanceof IFluidContainerItem container) {
FluidStack fluid = container.getFluid(itemStack);
if (fluid == null || !stack.getFluidStack().isFluidEqual(fluid))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 19 KiB