mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-06-26 12:21:43 +02:00
36 lines
1.2 KiB
Java
36 lines
1.2 KiB
Java
|
package de.ellpeck.naturesaura.compat.patchouli;
|
||
|
|
||
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||
|
import de.ellpeck.naturesaura.api.recipes.OfferingRecipe;
|
||
|
import net.minecraft.util.ResourceLocation;
|
||
|
import vazkii.patchouli.api.IComponentProcessor;
|
||
|
import vazkii.patchouli.api.IVariableProvider;
|
||
|
import vazkii.patchouli.api.PatchouliAPI;
|
||
|
|
||
|
public class ProcessorOffering implements IComponentProcessor {
|
||
|
|
||
|
private OfferingRecipe recipe;
|
||
|
|
||
|
@Override
|
||
|
public void setup(IVariableProvider<String> provider) {
|
||
|
ResourceLocation res = new ResourceLocation(provider.get("recipe"));
|
||
|
this.recipe = NaturesAuraAPI.OFFERING_RECIPES.get(res);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String process(String key) {
|
||
|
switch (key) {
|
||
|
case "input":
|
||
|
return PatchouliAPI.instance.serializeIngredient(this.recipe.input);
|
||
|
case "output":
|
||
|
return PatchouliAPI.instance.serializeItemStack(this.recipe.output);
|
||
|
case "start":
|
||
|
return PatchouliAPI.instance.serializeIngredient(this.recipe.startItem);
|
||
|
case "name":
|
||
|
return this.recipe.output.getDisplayName();
|
||
|
default:
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
}
|