2015-10-02 19:58:03 +02:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("NEICompostRecipe.java") is part of the Actually Additions mod for Minecraft.
|
2015-10-02 19:58:03 +02: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
|
2015-10-02 19:58:03 +02:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 Ellpeck
|
2015-10-02 19:58:03 +02:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.nei;
|
2015-10-02 19:58:03 +02:00
|
|
|
|
2016-01-23 12:09:29 +01:00
|
|
|
public class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{
|
2015-10-02 19:58:03 +02:00
|
|
|
|
|
|
|
public static final String NAME = "actuallyadditions.compost";
|
|
|
|
|
2016-01-23 12:09:29 +01:00
|
|
|
/*public NEICompostRecipe(){
|
2015-10-02 19:58:03 +02:00
|
|
|
super();
|
|
|
|
RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-11-27 16:44:39 +01:00
|
|
|
public BookletPage getPageForInfo(int page){
|
|
|
|
return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCompost));
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getRecipeName(){
|
|
|
|
return StringUtil.localize("container.nei."+NAME+".name");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void loadTransferRects(){
|
|
|
|
transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void loadCraftingRecipes(String outputId, Object... results){
|
2015-11-27 15:22:44 +01:00
|
|
|
if(outputId.equals(NAME) && getClass() == NEICompostRecipe.class){
|
2015-11-28 19:02:01 +01:00
|
|
|
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT)));
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
2015-10-03 10:16:18 +02:00
|
|
|
else{
|
|
|
|
super.loadCraftingRecipes(outputId, results);
|
|
|
|
}
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void loadCraftingRecipes(ItemStack result){
|
2015-10-03 10:16:18 +02:00
|
|
|
if(NEIServerUtils.areStacksSameType(new ItemStack(InitItems.itemFertilizer), result)){
|
2015-11-28 19:02:01 +01:00
|
|
|
arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT)));
|
2015-10-03 10:16:18 +02:00
|
|
|
}
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void loadUsageRecipes(ItemStack ingredient){
|
2015-11-28 19:02:01 +01:00
|
|
|
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), ingredient)){
|
|
|
|
CachedCompostRecipe theRecipe = new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT));
|
2015-10-02 19:58:03 +02:00
|
|
|
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient);
|
|
|
|
arecipes.add(theRecipe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getGuiTexture(){
|
2016-04-20 21:39:03 +02:00
|
|
|
return ModUtil.MOD_ID+":textures/gui/guiNEISimple.png";
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
|
|
|
|
2015-10-03 10:19:40 +02:00
|
|
|
@Override
|
|
|
|
public String getOverlayIdentifier(){
|
|
|
|
return NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Class<? extends GuiContainer> getGuiClass(){
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-10-02 19:58:03 +02:00
|
|
|
@Override
|
|
|
|
public void drawBackground(int recipeIndex){
|
2016-01-08 15:21:05 +01:00
|
|
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
2015-10-02 19:58:03 +02:00
|
|
|
GuiDraw.changeTexture(getGuiTexture());
|
|
|
|
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-10-03 10:19:40 +02:00
|
|
|
public int recipiesPerPage(){
|
|
|
|
return 2;
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|
2015-10-03 10:16:18 +02:00
|
|
|
|
|
|
|
public class CachedCompostRecipe extends CachedRecipe{
|
|
|
|
|
|
|
|
public PositionedStack result;
|
|
|
|
public PositionedStack input;
|
|
|
|
public int chance;
|
|
|
|
|
|
|
|
public CachedCompostRecipe(ItemStack input, ItemStack result){
|
|
|
|
this.result = new PositionedStack(result, 67+32, 19);
|
|
|
|
this.input = new PositionedStack(input, 5+32, 19);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-10-03 10:19:40 +02:00
|
|
|
public PositionedStack getResult(){
|
|
|
|
return result;
|
2015-10-03 10:16:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-10-03 10:19:40 +02:00
|
|
|
public PositionedStack getIngredient(){
|
|
|
|
return input;
|
2015-10-03 10:16:18 +02:00
|
|
|
}
|
2016-01-23 12:09:29 +01:00
|
|
|
}*/
|
2015-10-02 19:58:03 +02:00
|
|
|
}
|