ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/common/jei/compost/CompostRecipeWrapper.java

51 lines
1.7 KiB
Java
Raw Normal View History

2020-09-09 16:49:01 +02:00
package de.ellpeck.actuallyadditions.common.jei.compost;
2017-10-31 03:19:48 +01:00
import java.util.Arrays;
2017-10-31 03:19:48 +01:00
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
2020-09-09 16:49:01 +02:00
import de.ellpeck.actuallyadditions.common.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.booklet.misc.BookletUtils;
2020-09-09 16:49:01 +02:00
import de.ellpeck.actuallyadditions.common.jei.RecipeWrapperWithButton;
import de.ellpeck.actuallyadditions.common.tile.TileEntityCompost;
2017-10-31 03:19:48 +01:00
import mezz.jei.api.ingredients.IIngredients;
2018-12-11 07:18:31 +01:00
import mezz.jei.api.ingredients.VanillaTypes;
2017-10-31 03:19:48 +01:00
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
public class CompostRecipeWrapper extends RecipeWrapperWithButton {
2017-10-31 03:19:48 +01:00
public final CompostRecipe recipe;
2017-10-31 03:19:48 +01:00
public CompostRecipeWrapper(CompostRecipe recipe) {
this.recipe = recipe;
2017-10-31 03:19:48 +01:00
}
@Override
public void getIngredients(IIngredients ingredients) {
2019-02-27 19:53:05 +01:00
ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(this.recipe.getInput().getMatchingStacks()));
ingredients.setOutput(VanillaTypes.ITEM, this.recipe.getOutput());
2017-10-31 03:19:48 +01:00
}
@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
2017-10-31 03:19:48 +01:00
int bake_time = TileEntityCompost.COMPOST_TIME_TICKS / 20;
minecraft.fontRenderer.drawString(bake_time + "s", 28, 3, 0xFFFFFF, true);
2017-10-31 23:31:34 +01:00
//super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY); Not sure the button needs to be here.
2017-10-31 03:19:48 +01:00
}
@Override
public int getButtonX() {
2017-10-31 23:31:34 +01:00
return 32;
2017-10-31 03:19:48 +01:00
}
@Override
public int getButtonY() {
2017-10-31 23:31:34 +01:00
return 35;
2017-10-31 03:19:48 +01:00
}
@Override
public IBookletPage getPage() {
2017-10-31 03:19:48 +01:00
return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockCompost));
}
}