2014-04-29 10:54:20 +10:00
|
|
|
package codechicken.nei;
|
|
|
|
|
|
2023-09-25 00:34:42 +02:00
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
|
import net.minecraft.inventory.Slot;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2023-01-28 17:55:51 -08:00
|
|
|
|
2023-09-25 00:35:24 +02:00
|
|
|
import codechicken.lib.inventory.ContainerExtended;
|
|
|
|
|
import codechicken.lib.inventory.SlotDummy;
|
|
|
|
|
import codechicken.nei.api.INEIGuiAdapter;
|
|
|
|
|
|
2022-06-24 12:32:13 +01:00
|
|
|
public class NEIDummySlotHandler extends INEIGuiAdapter {
|
2023-01-28 17:55:51 -08:00
|
|
|
|
2014-04-29 10:54:20 +10:00
|
|
|
@Override
|
2022-06-24 12:32:13 +01:00
|
|
|
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
|
2014-04-29 10:54:20 +10:00
|
|
|
Slot slot = gui.getSlotAtPosition(mousex, mousey);
|
2022-06-24 12:32:13 +01:00
|
|
|
if (slot instanceof SlotDummy && slot.isItemValid(draggedStack)
|
|
|
|
|
&& gui.inventorySlots instanceof ContainerExtended) {
|
|
|
|
|
((SlotDummy) slot).slotClick(draggedStack, button, NEIClientUtils.shiftKey());
|
2014-04-29 10:54:20 +10:00
|
|
|
NEICPH.sendDummySlotSet(slot.slotNumber, slot.getStack());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|