2017-10-31 03:19:48 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.jei.compost;
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
2017-10-31 03:19:48 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
2018-06-24 02:44:47 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.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;
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public class CompostRecipeWrapper extends RecipeWrapperWithButton {
|
2017-10-31 03:19:48 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public final CompostRecipe recipe;
|
2017-10-31 03:19:48 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public CompostRecipeWrapper(CompostRecipe recipe) {
|
|
|
|
this.recipe = recipe;
|
2017-10-31 03:19:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-06-24 02:44:47 +02:00
|
|
|
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
|
2018-06-24 02:44:47 +02:00
|
|
|
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
|
2018-06-24 02:44:47 +02:00
|
|
|
public int getButtonX() {
|
2017-10-31 23:31:34 +01:00
|
|
|
return 32;
|
2017-10-31 03:19:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-06-24 02:44:47 +02:00
|
|
|
public int getButtonY() {
|
2017-10-31 23:31:34 +01:00
|
|
|
return 35;
|
2017-10-31 03:19:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-06-24 02:44:47 +02:00
|
|
|
public IBookletPage getPage() {
|
2017-10-31 03:19:48 +01:00
|
|
|
return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockCompost));
|
|
|
|
}
|
|
|
|
}
|