2021-12-15 16:24:53 +01:00
|
|
|
/*
|
2018-10-30 11:08:50 +01:00
|
|
|
package de.ellpeck.naturesaura.compat.patchouli;
|
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
import de.ellpeck.naturesaura.recipes.AltarRecipe;
|
2018-11-20 11:44:07 +01:00
|
|
|
import net.minecraft.item.crafting.Ingredient;
|
2018-10-30 11:08:50 +01:00
|
|
|
import vazkii.patchouli.api.IComponentProcessor;
|
2020-09-22 03:17:02 +02:00
|
|
|
import vazkii.patchouli.api.IVariable;
|
2018-10-30 11:08:50 +01:00
|
|
|
import vazkii.patchouli.api.IVariableProvider;
|
|
|
|
|
|
|
|
public class ProcessorAltar implements IComponentProcessor {
|
|
|
|
|
|
|
|
private AltarRecipe recipe;
|
|
|
|
|
|
|
|
@Override
|
2020-09-22 03:17:02 +02:00
|
|
|
public void setup(IVariableProvider provider) {
|
|
|
|
this.recipe = PatchouliCompat.getRecipe("altar", provider.get("recipe").asString());
|
2018-10-30 11:08:50 +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-10-30 11:08:50 +01:00
|
|
|
switch (key) {
|
|
|
|
case "input":
|
2020-09-22 18:03:56 +02:00
|
|
|
return PatchouliCompat.ingredientVariable(this.recipe.input);
|
2018-10-30 11:08:50 +01:00
|
|
|
case "output":
|
2020-09-22 03:17:02 +02:00
|
|
|
return IVariable.from(this.recipe.output);
|
2018-10-31 01:17:58 +01:00
|
|
|
case "catalyst":
|
2018-11-20 11:44:07 +01:00
|
|
|
if (this.recipe.catalyst != Ingredient.EMPTY)
|
2020-09-22 18:03:56 +02:00
|
|
|
return PatchouliCompat.ingredientVariable(this.recipe.catalyst);
|
2018-10-31 01:17:58 +01:00
|
|
|
else
|
2020-09-22 15:01:16 +02:00
|
|
|
return null;
|
2020-02-25 22:57:10 +01:00
|
|
|
case "type":
|
|
|
|
if (this.recipe.requiredType != null)
|
2020-09-28 01:50:17 +02:00
|
|
|
return IVariable.from(this.recipe.getDimensionBottle());
|
2020-02-25 22:57:10 +01:00
|
|
|
else
|
2020-09-22 15:01:16 +02:00
|
|
|
return null;
|
2018-10-30 11:08:50 +01:00
|
|
|
case "name":
|
2020-09-22 03:17:02 +02:00
|
|
|
return IVariable.wrap(this.recipe.output.getDisplayName().getString());
|
2018-10-30 11:08:50 +01:00
|
|
|
default:
|
2020-09-22 15:01:16 +02:00
|
|
|
return null;
|
2018-10-30 11:08:50 +01:00
|
|
|
}
|
|
|
|
}
|
2018-10-31 01:17:58 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean allowRender(String group) {
|
2018-11-20 11:44:07 +01:00
|
|
|
return group.isEmpty() || group.equals(this.recipe.catalyst == Ingredient.EMPTY ? "altar" : "catalyst");
|
2018-10-31 01:17:58 +01:00
|
|
|
}
|
2018-10-30 11:08:50 +01:00
|
|
|
}
|
2021-12-15 16:24:53 +01:00
|
|
|
*/
|