// Path: src/main/java/com/nauktis/core/utility/Utils.java
// public final class Utils {
//     public static final Random RANDOM = new Random();
// 
//     /**
//      * Utility class, no public constructor.
//      */
//     private Utils() {
// 
//     }
// 
//     /**
//      * Returns true for server side world.
//      */
//     public static boolean isServer(World pWorld) {
//         return !pWorld.isRemote;
//     }
// 
//     /**
//      * Returns true for client side world.
//      */
//     public static boolean isClient(World pWorld) {
//         return pWorld.isRemote;
//     }
// 
//     /**
//      * Returns true if the player has a usable wrench equipped.
//      */
//     public static boolean hasUsableWrench(EntityPlayer pPlayer, int pX, int pY, int pZ) {
//         ItemStack tool = pPlayer.getCurrentEquippedItem();
//         if (tool != null) {
//             if (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool.getItem() instanceof IToolWrench && ((IToolWrench) tool.getItem())
//                     .canWrench(pPlayer, pX, pY, pZ)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     /**
//      * Spawns an ItemStack in the World. No motion in X and Z axis.
//      */
//     public static void spawnItemStack(World pWorld, int pX, int pY, int pZ, ItemStack pItemStack) {
//         EntityItem entityItem = new EntityItem(pWorld, pX + 0.5, pY + 0.5, pZ + 0.5, pItemStack);
//         entityItem.motionX = 0;
//         entityItem.motionZ = 0;
//         pWorld.spawnEntityInWorld(entityItem);
//     }
// 
//     /**
//      * Returns true if the two ItemStacks contains exactly the same item without taking stack size into account.
//      * Credit to Pahimar.
//      */
//     public static boolean itemStacksEqualIgnoreStackSize(ItemStack pItemStack1, ItemStack pItemStack2) {
//         if (pItemStack1 != null && pItemStack2 != null) {
//             // Compare itemID
//             if (Item.getIdFromItem(pItemStack1.getItem()) - Item.getIdFromItem(pItemStack2.getItem()) == 0) {
//                 // Compare item
//                 if (pItemStack1.getItem() == pItemStack2.getItem()) {
//                     // Compare meta
//                     if (pItemStack1.getItemDamage() == pItemStack2.getItemDamage()) {
//                         // Compare NBT presence
//                         if (pItemStack1.hasTagCompound() && pItemStack2.hasTagCompound()) {
//                             // Compare NBT
//                             if (ItemStack.areItemStackTagsEqual(pItemStack1, pItemStack2)) {
//                                 return true;
//                             }
//                         } else if (!pItemStack1.hasTagCompound() && !pItemStack2.hasTagCompound()) {
//                             return true;
//                         }
//                     }
//                 }
//             }
//         }
//         return false;
//     }
// 
//     public static boolean isShiftKeyDown() {
//         return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
//     }
// }


import com.google.common.collect.Maps;
import com.nauktis.core.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import java.util.List;
import java.util.Map;
            }
        }
    }

    protected void addPlayerActionSlotsToContainer(InventoryPlayer pInventoryPlayer, int pLeft, int pTop) {
        for (int actionBarSlotIndex = 0; actionBarSlotIndex < 9; ++actionBarSlotIndex) {
            this.addSlotToContainer(new Slot(pInventoryPlayer, actionBarSlotIndex, pLeft + actionBarSlotIndex * 18, pTop));
        }
    }

    /**
     * Tries to add an ItemStack to slots in the range specified. It will first try to merge to an existing stack before using an empty one.
     *
     * @returns true if a slot was found.
     */
    @Override
    protected boolean mergeItemStack(ItemStack pItemStack, int pSlotMin, int pSlotMax, boolean pAscending) {

        boolean slotFound = false;
        int currentSlotIndex = pAscending ? pSlotMax - 1 : pSlotMin;

        Slot slot;
        ItemStack stackInSlot;

        // Try to merge to an existing ItemStack
        if (pItemStack.isStackable()) {
            while (pItemStack.stackSize > 0 && (!pAscending && currentSlotIndex < pSlotMax || pAscending && currentSlotIndex >= pSlotMin)) {
                slot = getSlot(currentSlotIndex);
                stackInSlot = slot.getStack();

// Path: src/main/java/com/nauktis/core/utility/Utils.java
// public final class Utils {
//     public static final Random RANDOM = new Random();
// 
//     /**
//      * Utility class, no public constructor.
//      */
//     private Utils() {
// 
//     }
// 
//     /**
//      * Returns true for server side world.
//      */
//     public static boolean isServer(World pWorld) {
//         return !pWorld.isRemote;
//     }
// 
//     /**
//      * Returns true for client side world.
//      */
//     public static boolean isClient(World pWorld) {
//         return pWorld.isRemote;
//     }
// 
//     /**
//      * Returns true if the player has a usable wrench equipped.
//      */
//     public static boolean hasUsableWrench(EntityPlayer pPlayer, int pX, int pY, int pZ) {
//         ItemStack tool = pPlayer.getCurrentEquippedItem();
//         if (tool != null) {
//             if (ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool.getItem() instanceof IToolWrench && ((IToolWrench) tool.getItem())
//                     .canWrench(pPlayer, pX, pY, pZ)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     /**
//      * Spawns an ItemStack in the World. No motion in X and Z axis.
//      */
//     public static void spawnItemStack(World pWorld, int pX, int pY, int pZ, ItemStack pItemStack) {
//         EntityItem entityItem = new EntityItem(pWorld, pX + 0.5, pY + 0.5, pZ + 0.5, pItemStack);
//         entityItem.motionX = 0;
//         entityItem.motionZ = 0;
//         pWorld.spawnEntityInWorld(entityItem);
//     }
// 
//     /**
//      * Returns true if the two ItemStacks contains exactly the same item without taking stack size into account.
//      * Credit to Pahimar.
//      */
//     public static boolean itemStacksEqualIgnoreStackSize(ItemStack pItemStack1, ItemStack pItemStack2) {
//         if (pItemStack1 != null && pItemStack2 != null) {
//             // Compare itemID
//             if (Item.getIdFromItem(pItemStack1.getItem()) - Item.getIdFromItem(pItemStack2.getItem()) == 0) {
//                 // Compare item
//                 if (pItemStack1.getItem() == pItemStack2.getItem()) {
//                     // Compare meta
//                     if (pItemStack1.getItemDamage() == pItemStack2.getItemDamage()) {
//                         // Compare NBT presence
//                         if (pItemStack1.hasTagCompound() && pItemStack2.hasTagCompound()) {
//                             // Compare NBT
//                             if (ItemStack.areItemStackTagsEqual(pItemStack1, pItemStack2)) {
//                                 return true;
//                             }
//                         } else if (!pItemStack1.hasTagCompound() && !pItemStack2.hasTagCompound()) {
//                             return true;
//                         }
//                     }
//                 }
//             }
//         }
//         return false;
//     }
// 
//     public static boolean isShiftKeyDown() {
//         return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
//     }
// }


// Path: src/main/java/com/nauktis/core/gui/BaseModContainer.java
import com.google.common.collect.Maps;
import com.nauktis.core.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import java.util.List;
import java.util.Map;

            }
        }
    }

    protected void addPlayerActionSlotsToContainer(InventoryPlayer pInventoryPlayer, int pLeft, int pTop) {
        for (int actionBarSlotIndex = 0; actionBarSlotIndex < 9; ++actionBarSlotIndex) {
            this.addSlotToContainer(new Slot(pInventoryPlayer, actionBarSlotIndex, pLeft + actionBarSlotIndex * 18, pTop));
        }
    }

    /**
     * Tries to add an ItemStack to slots in the range specified. It will first try to merge to an existing stack before using an empty one.
     *
     * @returns true if a slot was found.
     */
    @Override
    protected boolean mergeItemStack(ItemStack pItemStack, int pSlotMin, int pSlotMax, boolean pAscending) {

        boolean slotFound = false;
        int currentSlotIndex = pAscending ? pSlotMax - 1 : pSlotMin;

        Slot slot;
        ItemStack stackInSlot;

        // Try to merge to an existing ItemStack
        if (pItemStack.isStackable()) {
            while (pItemStack.stackSize > 0 && (!pAscending && currentSlotIndex < pSlotMax || pAscending && currentSlotIndex >= pSlotMin)) {
                slot = getSlot(currentSlotIndex);
                stackInSlot = slot.getStack();

                if (slot.isItemValid(pItemStack) && Utils.itemStacksEqualIgnoreStackSize(pItemStack, stackInSlot)) {