Fix pickup item from new slots when NEI is installed

This commit is contained in:
Ethryan committed 2025-06-14 11:07:28 +02:00
1 parent c6552ad0fd
commit d02abb059d
3 files changed
+17 -3

No files matched your search

@@ -7,11 +7,13 @@ import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.TaggedInventoryArea;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@@ -312,6 +314,16 @@ public class GuiPlayerExpanded extends GuiContainer implements INEIGuiHandler {
return Collections.emptyList();
}
@Override
protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) {
if (slotIn != null && clickType == 4 && slotIn.xDisplayPosition < 0 && !useOldGuiRendering) {
clickType = 0;
}
super.handleMouseClick(slotIn, slotId, clickedButton, clickType);
}
@Override
@Optional.Method(modid = "NotEnoughItems")
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
@@ -112,7 +112,7 @@ public class ContainerPlayerExpanded extends Container {
@Override
public void onCraftMatrixChanged(IInventory par1IInventory) {
if (!useOldGuiRendering) {
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj));
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj));
}
}
@@ -129,7 +129,9 @@ public class ContainerPlayerExpanded extends Container {
}
this.craftResult.setInventorySlotContents(0, (ItemStack) null);
//if (!player.worldObj.isRemote) {PlayerHandler.setPlayerBaubles(player, baubles);}
if (!player.worldObj.isRemote) {
PlayerHandler.setPlayerBaubles(player, baubles);
}
}
}
@@ -1,8 +1,8 @@
package baubles.common.event;
import org.lwjgl.input.Keyboard;
import baubles.common.network.PacketHandler;
import baubles.common.network.server.PacketOpenBaublesInventory;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.gameevent.InputEvent;