2020-01-21 21:04:44 +01:00
|
|
|
package de.ellpeck.naturesaura.compat.jei;
|
2018-11-21 01:05:50 +01:00
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.NaturesAura;
|
2020-04-29 16:38:50 +02:00
|
|
|
import de.ellpeck.naturesaura.recipes.OfferingRecipe;
|
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-11-21 01:05:50 +01:00
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
2020-01-21 21:04:44 +01:00
|
|
|
public class OfferingCategory implements IRecipeCategory<OfferingRecipe> {
|
2018-11-21 01:05:50 +01:00
|
|
|
|
|
|
|
private final IDrawable background;
|
|
|
|
|
|
|
|
public OfferingCategory(IGuiHelper helper) {
|
|
|
|
this.background = helper.createDrawable(new ResourceLocation(NaturesAura.MOD_ID, "textures/gui/jei/offering.png"), 0, 0, 87, 36);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-06-27 15:24:04 +02:00
|
|
|
public RecipeType<OfferingRecipe> getRecipeType() {
|
2018-11-21 01:05:50 +01:00
|
|
|
return JEINaturesAuraPlugin.OFFERING;
|
|
|
|
}
|
|
|
|
|
|
|
|
@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.OFFERING.getUid() + ".name");
|
2018-11-21 01:05:50 +01: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, OfferingRecipe recipe, IFocusGroup focuses) {
|
2022-09-30 15:39:20 +02:00
|
|
|
builder.addSlot(RecipeIngredientRole.INPUT, 1, 15).addItemStacks(Arrays.asList(recipe.input.getItems()));
|
|
|
|
builder.addSlot(RecipeIngredientRole.OUTPUT, 66, 15).addItemStack(recipe.output);
|
|
|
|
builder.addSlot(RecipeIngredientRole.INPUT, 28, 1).addItemStacks(Arrays.asList(recipe.startItem.getItems()));
|
2018-11-21 01:05:50 +01:00
|
|
|
}
|
|
|
|
}
|