diff --git a/src/main/java/com/github/vfyjxf/nee/client/GuiEventHandler.java b/src/main/java/com/github/vfyjxf/nee/client/GuiEventHandler.java index 7970539..5e9d603 100644 --- a/src/main/java/com/github/vfyjxf/nee/client/GuiEventHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/client/GuiEventHandler.java @@ -16,6 +16,7 @@ import com.github.vfyjxf.nee.network.NEENetworkHandler; import com.github.vfyjxf.nee.network.packet.PacketSlotStackChange; import com.github.vfyjxf.nee.utils.GuiUtils; import com.github.vfyjxf.nee.utils.ItemUtils; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; @@ -161,19 +162,22 @@ public class GuiEventHandler implements INEIGuiHandler { @Override public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, ItemStack draggedStack, int button) { - if (gui instanceof AEBaseGui) { - if (button != 2 && draggedStack != null) { - Slot currentSlot = gui.getSlotAtPosition(mouseX, mouseY); - if (currentSlot instanceof SlotFake && ((SlotFake) currentSlot).isEnabled()) { - List slots = new ArrayList<>(); - slots.add(currentSlot.slotNumber); - ItemStack copyStack = draggedStack.copy(); - copyStack.stackSize = useStackSizeFromNEI ? draggedStack.stackSize : draggedStackDefaultSize; - NEENetworkHandler.getInstance().sendToServer(new PacketSlotStackChange(copyStack, slots)); - if (!NEEConfig.keepGhostitems) { - draggedStack.stackSize = 0; + //When NEIAddons exist, give them to NEIAddons to handle + if(NEEConfig.enableNEIDragNDrop || Loader.isModLoaded("NEIAddons")) { + if (gui instanceof AEBaseGui) { + if (button != 2 && draggedStack != null) { + Slot currentSlot = gui.getSlotAtPosition(mouseX, mouseY); + if (currentSlot instanceof SlotFake && ((SlotFake) currentSlot).isEnabled()) { + List slots = new ArrayList<>(); + slots.add(currentSlot.slotNumber); + ItemStack copyStack = draggedStack.copy(); + copyStack.stackSize = useStackSizeFromNEI ? draggedStack.stackSize : draggedStackDefaultSize; + NEENetworkHandler.getInstance().sendToServer(new PacketSlotStackChange(copyStack, slots)); + if (!NEEConfig.keepGhostitems) { + draggedStack.stackSize = 0; + } + return true; } - return true; } } } diff --git a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java index 8edf1fb..726da35 100644 --- a/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java +++ b/src/main/java/com/github/vfyjxf/nee/config/NEEConfig.java @@ -28,6 +28,7 @@ public class NEEConfig { public static boolean matchOtherItems = true; public static boolean drawHighlight = true; public static boolean allowSynchronousSwitchIngredient = true; + public static boolean enableNEIDragNDrop = true; public static boolean useStackSizeFromNEI = true; public static boolean keepGhostitems = true; public static boolean enableCraftAmountSettingGui = false; @@ -73,6 +74,8 @@ public class NEEConfig { allowSynchronousSwitchIngredient = config.get(CATEGORY_OTHER_SETTINGS, "allowSynchronousSwitchIngredient", true, "If true, it will make all similar ingredient switch at the same time").getBoolean(true); + enableNEIDragNDrop = config.get(CATEGORY_OTHER_SETTINGS, "enableNEIDragNDrop", true, "").getBoolean(); + useStackSizeFromNEI = config.get(CATEGORY_OTHER_SETTINGS, "useStackSizeFromNEI", true, "Use the StackSize set by NEI").getBoolean();