mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-21 04:32:27 +00:00
Rollback PR#913 (#916)
This commit is contained in:
1 parent
bd17301cb9
commit
5dfcff6f30
2 files changed
+5
-26
No files matched your search
@@ -1,9 +1,6 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.ClientProxy.mc;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainerCreative;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -33,16 +30,9 @@ public class CheatItemHandler extends INEIGuiAdapter {
|
||||
.min(contents + add, Math.min(overSlot.getSlotStackLimit(), draggedStack.getMaxStackSize()));
|
||||
|
||||
if (total > contents) {
|
||||
if (mc.currentScreen instanceof GuiContainerCreative gcc) {
|
||||
mc.thePlayer.inventory.addItemStackToInventory(draggedStack);
|
||||
gcc.inventorySlots.detectAndSendChanges();
|
||||
} else {
|
||||
NEIClientUtils.setSlotContents(
|
||||
overSlot.slotNumber,
|
||||
NEIServerUtils.copyStack(draggedStack, total),
|
||||
true);
|
||||
NEICPH.sendGiveItem(NEIServerUtils.copyStack(draggedStack, total), false, false);
|
||||
}
|
||||
NEIClientUtils
|
||||
.setSlotContents(overSlot.slotNumber, NEIServerUtils.copyStack(draggedStack, total), true);
|
||||
NEICPH.sendGiveItem(NEIServerUtils.copyStack(draggedStack, total), false, false);
|
||||
draggedStack.stackSize -= total - contents;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user