NaturesAura/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java
2018-10-22 00:14:52 +02:00

41 lines
1 KiB
Java

package de.ellpeck.naturesaura.recipes;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import java.util.HashMap;
import java.util.Map;
public class AltarRecipe {
public static final Map<ResourceLocation, AltarRecipe> RECIPES = new HashMap<>();
public final ResourceLocation name;
public final ItemStack input;
public final ItemStack output;
public final int aura;
public final int time;
public AltarRecipe(ResourceLocation name, ItemStack input, ItemStack output, int aura, int time) {
this.name = name;
this.input = input;
this.output = output;
this.aura = aura;
this.time = time;
}
public static AltarRecipe forInput(ItemStack input) {
for (AltarRecipe recipe : RECIPES.values()) {
if (recipe.input.isItemEqual(input)) {
return recipe;
}
}
return null;
}
public AltarRecipe add() {
RECIPES.put(this.name, this);
return this;
}
}