// Path: src/main/java/com/dumptruckman/chestrestock/Players.java
// public final class Players {
//     
//     private Players() {
//         throw new AssertionError();
//     }
//     
//     public static CRPlayer newCRPlayer() {
//         return new DefaultCRPlayer(0, 0L);
//     }
// 
//     public static CRPlayer newCRPlayer(int lootCount, long lastRestock) {
//         return new DefaultCRPlayer(lootCount, lastRestock);
//     }
// }
// 
// Path: src/main/java/com/dumptruckman/chestrestock/util/BlockLocation.java
// public class BlockLocation {
//     
//     private static final String DELIMITER = "_";
// 
//     private final String world;
//     private final int x;
//     private final int y;
//     private final int z;
// 
//     private final String stringForm;
// 
//     private BlockLocation(Block block) {
//         this(block.getWorld(), block.getX(), block.getY(), block.getZ());
//     }
// 
//     private BlockLocation(World world, int x, int y, int z) {
//         this(world.getName(), x, y, z);
//     }
// 
//     private BlockLocation(String world, int x, int y, int z) {
//         this.world = world;
//         this.x = x;
//         this.y = y;
//         this.z = z;
//         this.stringForm = this.x + DELIMITER + this.y + DELIMITER + this.z + DELIMITER + this.world;
//     }
// 
//     public final String getWorldName() {
//         return world;
//     }
// 
//     public final World getWorld() {
//         return Bukkit.getWorld(this.world);
//     }
//     
//     public final Block getBlock() {
//         World world = getWorld();
//         if (world == null) {
//             return null;
//         }
//         return world.getBlockAt(getX(), getY(), getZ());
//     }
// 
//     public final int getX() {
//         return x;
//     }
// 
//     public final int getY() {
//         return y;
//     }
// 
//     public final int getZ() {
//         return z;
//     }
// 
//     @Override
//     public final String toString() {
//         return stringForm;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (o instanceof BlockLocation) {
//             BlockLocation otherLoc = (BlockLocation) o;
//             if (this.getWorld().equals(otherLoc.getWorld())
//                     && this.getX() == otherLoc.getX()
//                     && this.getY() == otherLoc.getY()
//                     && this.getZ() == otherLoc.getZ())  {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     @Override
//     public int hashCode() {
//         return this.toString().hashCode();
//     }
//     
//     public static BlockLocation get(String stringFormat) {
//         String[] sections = stringFormat.split(DELIMITER, 4);
//         if (sections.length != 4) {
//             Logging.finer("Unable to parse location: " + stringFormat);
//             return null;
//         }
//         try {
//             return new BlockLocation(sections[3],
//                     Integer.valueOf(sections[0]),
//                     Integer.valueOf(sections[1]),
//                     Integer.valueOf(sections[2]));
//         } catch (Exception e) {
//             Logging.finer("Unable to parse location: " + stringFormat);
//             return null;
//         }
//     }
// 
//     public static BlockLocation get(Block block) {
//         return new BlockLocation(block);
//     }
// }


import com.dumptruckman.chestrestock.Players;
import com.dumptruckman.chestrestock.util.BlockLocation;
import com.dumptruckman.minecraft.pluginbase.config.Config;
import com.dumptruckman.minecraft.pluginbase.config.ConfigEntry;
import com.dumptruckman.minecraft.pluginbase.config.EntryBuilder;
import com.dumptruckman.minecraft.pluginbase.config.EntrySerializer;
import com.dumptruckman.minecraft.pluginbase.config.MappedConfigEntry;
import com.dumptruckman.minecraft.pluginbase.util.Logging;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
package com.dumptruckman.chestrestock.api;



/**
 * An interface that represents a ChestRestock "chest".  Chest being any sort of block based inventory.
 */
public interface CRChest extends Config, CRChestOptions {

    /**
     * Constants related to CRChest.
     */
    class Constants {

        /**
         * The minimum for max inventory size.
         */
        public static final int MIN_MAX_INVENTORY_SIZE = 54;

        private static int MAX_INVENTORY_SIZE = MIN_MAX_INVENTORY_SIZE;

        /**
         * Sets the maximum size of any inventory for use in ChestRestock.
         *
         * @param size a value no less than {@link Constants#MIN_MAX_INVENTORY_SIZE}.
         */
        public static void setMaxInventorySize(int size) {
            if (size < MIN_MAX_INVENTORY_SIZE) {
                throw new IllegalArgumentException("Size may not be less than " + MIN_MAX_INVENTORY_SIZE);
            }
            MAX_INVENTORY_SIZE = size;
        }

        /**
         * @return the max size for any inventory for use in ChestRestock.
         */
        public static int getMaxInventorySize() {
            return MAX_INVENTORY_SIZE;
        }
    }

    /**
     * Indicates the maximum size of an inventory.
     * @deprecated as of release 2.3.  Use {@link CRConfig#MAX_INVENTORY_SIZE} and
     * {@link com.dumptruckman.chestrestock.api.CRChest.Constants#getMaxInventorySize()} instead.
     */
    @Deprecated
    int MAX_SIZE = 54;

    /**
     * The items this chest restocks with.
     */
// Path: src/main/java/com/dumptruckman/chestrestock/Players.java
// public final class Players {
//     
//     private Players() {
//         throw new AssertionError();
//     }
//     
//     public static CRPlayer newCRPlayer() {
//         return new DefaultCRPlayer(0, 0L);
//     }
// 
//     public static CRPlayer newCRPlayer(int lootCount, long lastRestock) {
//         return new DefaultCRPlayer(lootCount, lastRestock);
//     }
// }
// 
// Path: src/main/java/com/dumptruckman/chestrestock/util/BlockLocation.java
// public class BlockLocation {
//     
//     private static final String DELIMITER = "_";
// 
//     private final String world;
//     private final int x;
//     private final int y;
//     private final int z;
// 
//     private final String stringForm;
// 
//     private BlockLocation(Block block) {
//         this(block.getWorld(), block.getX(), block.getY(), block.getZ());
//     }
// 
//     private BlockLocation(World world, int x, int y, int z) {
//         this(world.getName(), x, y, z);
//     }
// 
//     private BlockLocation(String world, int x, int y, int z) {
//         this.world = world;
//         this.x = x;
//         this.y = y;
//         this.z = z;
//         this.stringForm = this.x + DELIMITER + this.y + DELIMITER + this.z + DELIMITER + this.world;
//     }
// 
//     public final String getWorldName() {
//         return world;
//     }
// 
//     public final World getWorld() {
//         return Bukkit.getWorld(this.world);
//     }
//     
//     public final Block getBlock() {
//         World world = getWorld();
//         if (world == null) {
//             return null;
//         }
//         return world.getBlockAt(getX(), getY(), getZ());
//     }
// 
//     public final int getX() {
//         return x;
//     }
// 
//     public final int getY() {
//         return y;
//     }
// 
//     public final int getZ() {
//         return z;
//     }
// 
//     @Override
//     public final String toString() {
//         return stringForm;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (o instanceof BlockLocation) {
//             BlockLocation otherLoc = (BlockLocation) o;
//             if (this.getWorld().equals(otherLoc.getWorld())
//                     && this.getX() == otherLoc.getX()
//                     && this.getY() == otherLoc.getY()
//                     && this.getZ() == otherLoc.getZ())  {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     @Override
//     public int hashCode() {
//         return this.toString().hashCode();
//     }
//     
//     public static BlockLocation get(String stringFormat) {
//         String[] sections = stringFormat.split(DELIMITER, 4);
//         if (sections.length != 4) {
//             Logging.finer("Unable to parse location: " + stringFormat);
//             return null;
//         }
//         try {
//             return new BlockLocation(sections[3],
//                     Integer.valueOf(sections[0]),
//                     Integer.valueOf(sections[1]),
//                     Integer.valueOf(sections[2]));
//         } catch (Exception e) {
//             Logging.finer("Unable to parse location: " + stringFormat);
//             return null;
//         }
//     }
// 
//     public static BlockLocation get(Block block) {
//         return new BlockLocation(block);
//     }
// }


// Path: src/main/java/com/dumptruckman/chestrestock/api/CRChest.java
import com.dumptruckman.chestrestock.Players;
import com.dumptruckman.chestrestock.util.BlockLocation;
import com.dumptruckman.minecraft.pluginbase.config.Config;
import com.dumptruckman.minecraft.pluginbase.config.ConfigEntry;
import com.dumptruckman.minecraft.pluginbase.config.EntryBuilder;
import com.dumptruckman.minecraft.pluginbase.config.EntrySerializer;
import com.dumptruckman.minecraft.pluginbase.config.MappedConfigEntry;
import com.dumptruckman.minecraft.pluginbase.util.Logging;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

package com.dumptruckman.chestrestock.api;



/**
 * An interface that represents a ChestRestock "chest".  Chest being any sort of block based inventory.
 */
public interface CRChest extends Config, CRChestOptions {

    /**
     * Constants related to CRChest.
     */
    class Constants {

        /**
         * The minimum for max inventory size.
         */
        public static final int MIN_MAX_INVENTORY_SIZE = 54;

        private static int MAX_INVENTORY_SIZE = MIN_MAX_INVENTORY_SIZE;

        /**
         * Sets the maximum size of any inventory for use in ChestRestock.
         *
         * @param size a value no less than {@link Constants#MIN_MAX_INVENTORY_SIZE}.
         */
        public static void setMaxInventorySize(int size) {
            if (size < MIN_MAX_INVENTORY_SIZE) {
                throw new IllegalArgumentException("Size may not be less than " + MIN_MAX_INVENTORY_SIZE);
            }
            MAX_INVENTORY_SIZE = size;
        }

        /**
         * @return the max size for any inventory for use in ChestRestock.
         */
        public static int getMaxInventorySize() {
            return MAX_INVENTORY_SIZE;
        }
    }

    /**
     * Indicates the maximum size of an inventory.
     * @deprecated as of release 2.3.  Use {@link CRConfig#MAX_INVENTORY_SIZE} and
     * {@link com.dumptruckman.chestrestock.api.CRChest.Constants#getMaxInventorySize()} instead.
     */
    @Deprecated
    int MAX_SIZE = 54;

    /**
     * The items this chest restocks with.
     */
    ConfigEntry<ItemStack[]> ITEMS = new EntryBuilder<ItemStack[]>(ItemStack[].class, "items")