}
}
}
if (Minecraft.getMinecraft().isMultiplayerWorld() && slot > -1) {
int window = Minecraft.getMinecraft().thePlayer.openContainer.windowId;
ItemStack replacement = inventory.mainInventory[slot].copy();
Minecraft.getMinecraft().playerController.windowClick(window, slot < 9 ? slot + 36 : slot, 0, 0, Minecraft.getMinecraft().thePlayer);
Minecraft.getMinecraft().playerController.windowClick(window, inventory.currentItem + 36, 0, 0, Minecraft.getMinecraft().thePlayer);
((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.addToSendQueue(new Packet101CloseWindow(window));
((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.queued = true;
((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.packetQueueTime = System.currentTimeMillis() + 30L;
ItemStack current = inventory.mainInventory[inventory.currentItem];
if (replacement != null && current != null) {
current.stackSize = replacement.stackSize;
current.setItemDamage(replacement.getItemDamage());
}
inventory.mainInventory[slot] = null;
}
}