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

61 lines
2 KiB
Java
Raw Normal View History

2017-10-31 03:19:48 +01:00
/*
* This file ("CompostRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.jei.compost;
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;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
2017-10-31 03:19:48 +01:00
import mezz.jei.api.ingredients.IIngredients;
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) {
ingredients.setInputs(ItemStack.class, Arrays.asList(recipe.getInput().getMatchingStacks()));
ingredients.setOutput(ItemStack.class, 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));
}
}