2015-11-02 20:39:44 +00:00
|
|
|
package WayofTime.bloodmagic.api.registry;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2015-11-02 20:39:44 +00:00
|
|
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
2015-11-03 18:00:40 +00:00
|
|
|
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
2015-11-02 20:39:44 +00:00
|
|
|
import WayofTime.bloodmagic.api.altar.AltarRecipe;
|
2015-10-30 03:22:14 +00:00
|
|
|
import com.google.common.collect.BiMap;
|
|
|
|
import com.google.common.collect.HashBiMap;
|
|
|
|
import lombok.Getter;
|
|
|
|
|
|
|
|
public class AltarRecipeRegistry {
|
|
|
|
|
|
|
|
@Getter
|
2015-11-03 18:00:40 +00:00
|
|
|
private static BiMap<ItemStackWrapper, AltarRecipe> recipes = HashBiMap.create();
|
2015-10-30 03:22:14 +00:00
|
|
|
|
|
|
|
public static void registerRecipe(AltarRecipe recipe) {
|
|
|
|
if (!recipes.containsValue(recipe))
|
|
|
|
recipes.put(recipe.input, recipe);
|
|
|
|
else
|
2015-11-02 20:39:44 +00:00
|
|
|
BloodMagicAPI.getLogger().error("Error adding recipe for " + recipe.input.getDisplayName() + (recipe.output == null ? "" : " -> " + recipe.output.getDisplayName()) + ". Recipe already exists.");
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
|
2015-11-03 18:00:40 +00:00
|
|
|
public static AltarRecipe getRecipeForInput(ItemStackWrapper input) {
|
|
|
|
return recipes.get(input);
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
}
|