ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java

58 lines
1.6 KiB
Java
Raw Normal View History

/*
* This file ("CompostRecipe.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
*
2017-01-01 16:23:26 +01:00
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.api.recipe;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
2019-05-02 09:10:29 +02:00
public class CompostRecipe {
protected final Ingredient input;
protected final ItemStack output;
protected final IBlockState inputDisplay;
protected final IBlockState outputDisplay;
@Deprecated
public CompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay) {
this(Ingredient.fromStacks(input), inputDisplay.getDefaultState(), output, outputDisplay.getDefaultState());
}
2019-02-27 19:53:05 +01:00
2019-05-02 09:10:29 +02:00
public CompostRecipe(Ingredient input, IBlockState inputDisplay, ItemStack output, IBlockState outputDisplay) {
this.input = input;
this.output = output;
this.inputDisplay = inputDisplay;
this.outputDisplay = outputDisplay;
}
2019-02-27 19:53:05 +01:00
public boolean matches(ItemStack stack) {
2019-02-27 19:53:05 +01:00
return this.input.apply(stack);
}
2019-02-27 19:53:05 +01:00
public Ingredient getInput() {
2019-02-27 19:53:05 +01:00
return this.input;
}
2019-02-27 19:53:05 +01:00
public ItemStack getOutput() {
2019-02-27 19:53:05 +01:00
return this.output;
}
2019-02-27 19:53:05 +01:00
public IBlockState getInputDisplay() {
2019-02-27 19:53:05 +01:00
return this.inputDisplay;
}
2019-02-27 19:53:05 +01:00
public IBlockState getOutputDisplay() {
2019-02-27 19:53:05 +01:00
return this.outputDisplay;
}
}