2016-01-17 15:09:59 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("CrusherRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-17 15:09:59 +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 15:09:59 +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 15:09:59 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.jei.crusher;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.api.booklet.BookletPage;
|
|
|
|
import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
2016-10-29 10:47:33 +02:00
|
|
|
import mezz.jei.api.ingredients.IIngredients;
|
2016-01-17 15:09:59 +01:00
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2016-10-30 17:13:46 +01:00
|
|
|
import java.util.Collections;
|
2016-01-17 15:09:59 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
2016-10-31 20:19:55 +01:00
|
|
|
public class CrusherRecipeWrapper extends RecipeWrapperWithButton{
|
2016-01-17 15:09:59 +01:00
|
|
|
|
2016-05-19 20:05:12 +02:00
|
|
|
public final CrusherRecipe theRecipe;
|
2016-01-17 15:09:59 +01:00
|
|
|
|
|
|
|
public CrusherRecipeWrapper(CrusherRecipe recipe){
|
|
|
|
this.theRecipe = recipe;
|
|
|
|
}
|
|
|
|
|
2016-10-29 10:47:33 +02:00
|
|
|
@Override
|
|
|
|
public void getIngredients(IIngredients ingredients){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-01-17 15:09:59 +01:00
|
|
|
@Override
|
|
|
|
public List getInputs(){
|
2016-10-30 17:13:46 +01:00
|
|
|
return Collections.singletonList(this.theRecipe.inputStack);
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List getOutputs(){
|
|
|
|
List list = new ArrayList();
|
2016-10-30 17:13:46 +01:00
|
|
|
list.add(this.theRecipe.outputOneStack);
|
|
|
|
if(this.theRecipe.outputTwoStack != null){
|
|
|
|
list.add(this.theRecipe.outputTwoStack);
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<FluidStack> getFluidInputs(){
|
2016-01-20 20:09:03 +01:00
|
|
|
return new ArrayList<FluidStack>();
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<FluidStack> getFluidOutputs(){
|
2016-01-20 20:09:03 +01:00
|
|
|
return new ArrayList<FluidStack>();
|
2016-01-17 15:09:59 +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-10-30 17:13:46 +01:00
|
|
|
if(this.theRecipe.outputTwoStack != null){
|
2016-01-17 15:09:59 +01:00
|
|
|
minecraft.fontRendererObj.drawString(this.theRecipe.outputTwoChance+"%", 60, 60, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
|
|
|
}
|
|
|
|
|
2016-10-31 20:19:55 +01:00
|
|
|
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-10-31 20:19:55 +01:00
|
|
|
public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){
|
2016-01-17 15:09:59 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getButtonX(){
|
|
|
|
return -5;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getButtonY(){
|
|
|
|
return 26;
|
|
|
|
}
|
2016-02-01 17:49:55 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public BookletPage getPage(){
|
|
|
|
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder));
|
|
|
|
}
|
2016-01-17 15:09:59 +01:00
|
|
|
}
|