Files
NotEnoughItems/src/main/java/codechicken/nei/NEIDummySlotHandler.java
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
913 B
Java
Raw Normal View History

2014-04-29 10:54:20 +10:00
package codechicken.nei;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
2015-05-29 18:05:13 +10:00
import codechicken.lib.inventory.ContainerExtended;
import codechicken.lib.inventory.SlotDummy;
2014-04-29 10:54:20 +10:00
import codechicken.nei.api.INEIGuiAdapter;
public class NEIDummySlotHandler extends INEIGuiAdapter {
2014-04-29 10:54:20 +10:00
@Override
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);
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;
}
}