2018-11-21 11:49:21 +01:00
|
|
|
package de.ellpeck.naturesaura.compat.patchouli;
|
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
import de.ellpeck.naturesaura.recipes.OfferingRecipe;
|
2018-11-21 11:49:21 +01:00
|
|
|
import vazkii.patchouli.api.IComponentProcessor;
|
2020-09-22 03:17:02 +02:00
|
|
|
import vazkii.patchouli.api.IVariable;
|
2018-11-21 11:49:21 +01:00
|
|
|
import vazkii.patchouli.api.IVariableProvider;
|
|
|
|
|
|
|
|
public class ProcessorOffering implements IComponentProcessor {
|
|
|
|
|
|
|
|
private OfferingRecipe recipe;
|
|
|
|
|
|
|
|
@Override
|
2020-09-22 03:17:02 +02:00
|
|
|
public void setup(IVariableProvider provider) {
|
|
|
|
this.recipe = PatchouliCompat.getRecipe("offering", provider.get("recipe").asString());
|
2018-11-21 11:49:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-09-22 03:17:02 +02:00
|
|
|
public IVariable process(String key) {
|
2019-03-31 10:21:59 +02:00
|
|
|
if (this.recipe == null)
|
2020-09-22 15:01:16 +02:00
|
|
|
return null;
|
2018-11-21 11:49:21 +01:00
|
|
|
switch (key) {
|
|
|
|
case "input":
|
2020-09-22 18:03:56 +02:00
|
|
|
return PatchouliCompat.ingredientVariable(this.recipe.input);
|
2018-11-21 11:49:21 +01:00
|
|
|
case "output":
|
2020-09-22 03:17:02 +02:00
|
|
|
return IVariable.from(this.recipe.output);
|
2018-11-21 11:49:21 +01:00
|
|
|
case "start":
|
2020-09-22 18:03:56 +02:00
|
|
|
return PatchouliCompat.ingredientVariable(this.recipe.startItem);
|
2018-11-21 11:49:21 +01:00
|
|
|
case "name":
|
2020-09-22 03:17:02 +02:00
|
|
|
return IVariable.wrap(this.recipe.output.getDisplayName().getString());
|
2018-11-21 11:49:21 +01:00
|
|
|
default:
|
2020-09-22 15:01:16 +02:00
|
|
|
return null;
|
2018-11-21 11:49:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|