// Path: src/main/java/oreregistry/api/IUnificationHandler.java
// @FunctionalInterface
// public interface IUnificationHandler {
// 	
// 	void onUnifyItem(ItemStack oldStack, ItemStack newStack, IProduct product);
// }
// 
// Path: src/main/java/oreregistry/api/OreRegistryState.java
// public enum OreRegistryState {
//     /**
//      * This state is active if in the pre init phase of fml.
//      */
//     ACTIVE,
//     /**
//      * This state is always active after the pre init phase of fml except the mod chooses currently his products or its currently synchronises with the server.
//      */
//     INACTIVE,
//     /**
//      * This state is active if the client currently synchronises with the server.
//      */
//     SYNCHRONIZE,
//     /**
//      * This state is active if the mod currently chooses the products.
//      */
//     CHOOSE
// 
// }
// 
// Path: src/main/java/oreregistry/api/registry/IResource.java
// public interface IResource {
// 
// 	/**
// 	 * The type of the resource. For examples see {@link ResourceTypes}.
// 	 */
// 	String getType();
// 
// 	/**
// 	 * Register a product added by your mod for this resource.
// 	 *
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @param product     The product provided by your mod.
// 	 * @return the product that should be used by every mod.
// 	 */
// 	IProduct registerProduct(String productType, ItemStack product);
// 
// 	/**
// 	 * 
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @return True if it is already a product registered with this type.
// 	 */
// 	boolean hasProduct(String productType);
// 
// 	/**
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @return The product of the productType, if one is registered.
// 	 */
// 	@Nullable
// 	IProduct getProduct(String productType);
// 	
// 	/**
// 	 * Returns a read-only map containing product types and their associated products.
// 	 */
// 	Map<String, IProduct> getRegisteredProducts();
// 
// }
// 
// Path: src/main/java/oreregistry/api/registry/IResourceRegistry.java
// public interface IResourceRegistry {
// 
// 	/**
// 	 * Register a type of resource added by your mod.
// 	 */
// 	IResource registerResource(String resourceType);
// 	
// 	/**
// 	 * Returns a read-only map containing resource names and their associated
// 	 * resources.
// 	 */
// 	Map<String, IResource> getRegisteredResources();
// 	
// 	/**
// 	 * Register a {@link IUnificationHandler}.
// 	 */
// 	void registerUnificationHandler(String resourceType, IUnificationHandler unificationHandler);
// 	
// 	/**
// 	 * Returns a read-only map containing all {@link IUnificationHandler}s of the resource of this type.
// 	 */
// 	Collection<IUnificationHandler> getUnificationHandlers(String resourceType);
// 	
// 	/**
// 	 * The current state of the registry process.
// 	 *
// 	 * You only can register resources and products in the active state.
// 	 */
// 	OreRegistryState getState();
// 
// }


import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import oreregistry.api.IUnificationHandler;
import oreregistry.api.OreRegistryState;
import oreregistry.api.registry.IResource;
import oreregistry.api.registry.IResourceRegistry;
/*
 * Copyright (c) 2017 Nedelosk, Mezz
 *
 * This work (the MOD) is licensed under the "MIT" License, see LICENSE for details.
 */
package oreregistry.util;




public final class ResourceRegistry implements IResourceRegistry {

	private final Map<String, IResource> resources = new HashMap<>();
// Path: src/main/java/oreregistry/api/IUnificationHandler.java
// @FunctionalInterface
// public interface IUnificationHandler {
// 	
// 	void onUnifyItem(ItemStack oldStack, ItemStack newStack, IProduct product);
// }
// 
// Path: src/main/java/oreregistry/api/OreRegistryState.java
// public enum OreRegistryState {
//     /**
//      * This state is active if in the pre init phase of fml.
//      */
//     ACTIVE,
//     /**
//      * This state is always active after the pre init phase of fml except the mod chooses currently his products or its currently synchronises with the server.
//      */
//     INACTIVE,
//     /**
//      * This state is active if the client currently synchronises with the server.
//      */
//     SYNCHRONIZE,
//     /**
//      * This state is active if the mod currently chooses the products.
//      */
//     CHOOSE
// 
// }
// 
// Path: src/main/java/oreregistry/api/registry/IResource.java
// public interface IResource {
// 
// 	/**
// 	 * The type of the resource. For examples see {@link ResourceTypes}.
// 	 */
// 	String getType();
// 
// 	/**
// 	 * Register a product added by your mod for this resource.
// 	 *
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @param product     The product provided by your mod.
// 	 * @return the product that should be used by every mod.
// 	 */
// 	IProduct registerProduct(String productType, ItemStack product);
// 
// 	/**
// 	 * 
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @return True if it is already a product registered with this type.
// 	 */
// 	boolean hasProduct(String productType);
// 
// 	/**
// 	 * @param productType The type of the product. For examples see {@link ProductTypes}.
// 	 * @return The product of the productType, if one is registered.
// 	 */
// 	@Nullable
// 	IProduct getProduct(String productType);
// 	
// 	/**
// 	 * Returns a read-only map containing product types and their associated products.
// 	 */
// 	Map<String, IProduct> getRegisteredProducts();
// 
// }
// 
// Path: src/main/java/oreregistry/api/registry/IResourceRegistry.java
// public interface IResourceRegistry {
// 
// 	/**
// 	 * Register a type of resource added by your mod.
// 	 */
// 	IResource registerResource(String resourceType);
// 	
// 	/**
// 	 * Returns a read-only map containing resource names and their associated
// 	 * resources.
// 	 */
// 	Map<String, IResource> getRegisteredResources();
// 	
// 	/**
// 	 * Register a {@link IUnificationHandler}.
// 	 */
// 	void registerUnificationHandler(String resourceType, IUnificationHandler unificationHandler);
// 	
// 	/**
// 	 * Returns a read-only map containing all {@link IUnificationHandler}s of the resource of this type.
// 	 */
// 	Collection<IUnificationHandler> getUnificationHandlers(String resourceType);
// 	
// 	/**
// 	 * The current state of the registry process.
// 	 *
// 	 * You only can register resources and products in the active state.
// 	 */
// 	OreRegistryState getState();
// 
// }


// Path: src/main/java/oreregistry/util/ResourceRegistry.java
import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import oreregistry.api.IUnificationHandler;
import oreregistry.api.OreRegistryState;
import oreregistry.api.registry.IResource;
import oreregistry.api.registry.IResourceRegistry;

/*
 * Copyright (c) 2017 Nedelosk, Mezz
 *
 * This work (the MOD) is licensed under the "MIT" License, see LICENSE for details.
 */
package oreregistry.util;




public final class ResourceRegistry implements IResourceRegistry {

	private final Map<String, IResource> resources = new HashMap<>();
	private final Multimap<String, IUnificationHandler> unificationHandlers = HashMultimap.create();