2016-01-17 12:17:24 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("CoffeeMachineRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-17 12:17:24 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-17 12:17:24 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 Ellpeck
|
2016-01-17 12:17:24 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
2016-01-17 12:17:24 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
2016-05-14 13:51:18 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
2016-01-17 12:17:24 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
|
|
|
import mezz.jei.api.recipe.IRecipeWrapper;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
|
|
|
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{
|
|
|
|
|
2016-05-19 20:05:12 +02:00
|
|
|
public final CoffeeIngredient theIngredient;
|
|
|
|
public final ItemStack theOutput;
|
|
|
|
public final ItemStack cup = new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal());
|
|
|
|
public final ItemStack coffeeBeans = new ItemStack(InitItems.itemCoffeeBean);
|
2016-01-17 12:17:24 +01:00
|
|
|
|
|
|
|
public CoffeeMachineRecipeWrapper(CoffeeIngredient ingredient){
|
|
|
|
this.theIngredient = ingredient;
|
|
|
|
|
|
|
|
this.theOutput = new ItemStack(InitItems.itemCoffee);
|
2016-05-14 13:51:18 +02:00
|
|
|
ActuallyAdditionsAPI.methodHandler.addEffectToStack(this.theOutput, this.theIngredient);
|
2016-01-17 12:17:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List getInputs(){
|
|
|
|
List list = new ArrayList();
|
|
|
|
list.add(this.theIngredient.ingredient);
|
|
|
|
list.add(this.cup);
|
|
|
|
list.add(this.coffeeBeans);
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List getOutputs(){
|
|
|
|
return Collections.singletonList(this.theOutput);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<FluidStack> getFluidInputs(){
|
2016-01-20 20:09:03 +01:00
|
|
|
return new ArrayList<FluidStack>();
|
2016-01-17 12:17:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<FluidStack> getFluidOutputs(){
|
2016-01-20 20:09:03 +01:00
|
|
|
return new ArrayList<FluidStack>();
|
2016-01-17 12:17:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-29 23:49:35 +02:00
|
|
|
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){
|
2016-01-17 12:17:24 +01:00
|
|
|
this.updateButton(minecraft, mouseX, mouseY);
|
2016-01-17 15:09:59 +01:00
|
|
|
|
|
|
|
if(this.theIngredient.getExtraText() != null){
|
2016-04-20 21:39:03 +02:00
|
|
|
minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
2016-01-17 15:09:59 +01:00
|
|
|
minecraft.fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.theIngredient.maxAmplifier > 0){
|
2016-04-20 21:39:03 +02:00
|
|
|
minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|
2016-01-17 12:17:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-29 23:49:35 +02:00
|
|
|
public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){
|
2016-01-17 12:17:24 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public List<String> getTooltipStrings(int mouseX, int mouseY){
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-05-29 23:49:35 +02:00
|
|
|
public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton){
|
2016-01-17 12:17:24 +01:00
|
|
|
return this.handleClick(minecraft, mouseX, mouseY);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getButtonX(){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getButtonY(){
|
|
|
|
return 70;
|
|
|
|
}
|
2016-02-01 17:49:55 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public BookletPage getPage(){
|
|
|
|
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine));
|
|
|
|
}
|
2016-01-17 12:17:24 +01:00
|
|
|
}
|