2020-01-21 21:04:44 +01:00
|
|
|
package de.ellpeck.naturesaura.compat.jei;
|
2018-10-16 21:10:38 +02:00
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.NaturesAura;
|
2020-04-29 16:38:50 +02:00
|
|
|
import de.ellpeck.naturesaura.recipes.TreeRitualRecipe;
|
2022-06-27 15:24:04 +02:00
|
|
|
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
2020-01-21 21:04:44 +01:00
|
|
|
import mezz.jei.api.gui.drawable.IDrawable;
|
|
|
|
import mezz.jei.api.helpers.IGuiHelper;
|
2022-06-27 15:24:04 +02:00
|
|
|
import mezz.jei.api.recipe.IFocusGroup;
|
|
|
|
import mezz.jei.api.recipe.RecipeIngredientRole;
|
|
|
|
import mezz.jei.api.recipe.RecipeType;
|
2020-01-21 21:04:44 +01:00
|
|
|
import mezz.jei.api.recipe.category.IRecipeCategory;
|
2021-12-19 17:14:56 +01:00
|
|
|
import net.minecraft.network.chat.Component;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
2018-10-16 21:10:38 +02:00
|
|
|
|
2018-11-20 11:44:07 +01:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
2020-01-21 21:04:44 +01:00
|
|
|
public class TreeRitualCategory implements IRecipeCategory<TreeRitualRecipe> {
|
2018-10-16 21:10:38 +02:00
|
|
|
|
|
|
|
private final IDrawable background;
|
|
|
|
|
|
|
|
public TreeRitualCategory(IGuiHelper helper) {
|
2018-10-22 00:14:52 +02:00
|
|
|
this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/jei/tree_ritual.png"), 0, 0, 146, 86);
|
2018-10-16 21:10:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-27 15:24:04 +02:00
|
|
|
public RecipeType<TreeRitualRecipe> getRecipeType() {
|
2018-10-16 21:10:38 +02:00
|
|
|
return JEINaturesAuraPlugin.TREE_RITUAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-12-19 17:14:56 +01:00
|
|
|
public Component getTitle() {
|
2022-09-30 15:39:20 +02:00
|
|
|
return Component.translatable("container." + JEINaturesAuraPlugin.TREE_RITUAL.getUid() + ".name");
|
2018-10-16 21:10:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IDrawable getBackground() {
|
|
|
|
return this.background;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-01-21 21:04:44 +01:00
|
|
|
public IDrawable getIcon() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-27 15:24:04 +02:00
|
|
|
public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) {
|
2022-09-30 15:39:20 +02:00
|
|
|
builder.addSlot(RecipeIngredientRole.CATALYST, 35, 35).addItemStacks(Arrays.asList(recipe.saplingType.getItems()));
|
2024-03-12 20:09:56 +01:00
|
|
|
builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.output);
|
2018-10-16 21:10:38 +02:00
|
|
|
|
2021-12-19 17:14:56 +01:00
|
|
|
var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}};
|
2024-03-10 15:54:58 +01:00
|
|
|
for (var i = 0; i < recipe.ingredients.size(); i++)
|
|
|
|
builder.addSlot(RecipeIngredientRole.INPUT, positions[i][0], positions[i][1]).addItemStacks(Arrays.asList(recipe.ingredients.get(i).getItems()));
|
2018-10-16 21:10:38 +02:00
|
|
|
}
|
2022-06-27 15:24:04 +02:00
|
|
|
|
2018-10-16 21:10:38 +02:00
|
|
|
}
|