NaturesAura/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java

51 lines
1.6 KiB
Java
Raw Normal View History

2021-12-15 16:24:53 +01:00
/*
package de.ellpeck.naturesaura.compat.patchouli;
2020-04-29 16:38:50 +02:00
import de.ellpeck.naturesaura.recipes.AltarRecipe;
import net.minecraft.item.crafting.Ingredient;
import vazkii.patchouli.api.IComponentProcessor;
2020-09-22 03:17:02 +02:00
import vazkii.patchouli.api.IVariable;
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());
}
@Override
2020-09-22 03:17:02 +02:00
public IVariable process(String key) {
if (this.recipe == null)
2020-09-22 15:01:16 +02:00
return null;
switch (key) {
case "input":
2020-09-22 18:03:56 +02:00
return PatchouliCompat.ingredientVariable(this.recipe.input);
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":
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)
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;
case "name":
2020-09-22 03:17:02 +02:00
return IVariable.wrap(this.recipe.output.getDisplayName().getString());
default:
2020-09-22 15:01:16 +02:00
return null;
}
}
2018-10-31 01:17:58 +01:00
@Override
public boolean allowRender(String group) {
return group.isEmpty() || group.equals(this.recipe.catalyst == Ingredient.EMPTY ? "altar" : "catalyst");
2018-10-31 01:17:58 +01:00
}
}
2021-12-15 16:24:53 +01:00
*/