use of cc.lasmgratel.foodcraftreloaded.minecraft.api.recipe.RecipeInput in project FoodCraft-Reloaded by LasmGratel.
the class TileEntityDrinkMachine method startProgress.
@Override
public void startProgress() {
DrinkRecipe recipe = RecipeManager.getInstance().getRecipeNullable(DrinkRecipe.class, new RecipeInput(itemStackHandler.getStackInSlot(0).getItem()));
if (recipe != null) {
FoodCraftReloaded.getLogger().debug("Drink machine: Found recipe " + recipe.getOutput().<FluidStack>first().getFluid().getName());
fluidOutput = recipe.getOutput().first();
output = recipe.getOutput().second();
itemStackHandler.getStackInSlot(0).splitStack(1);
}
}
use of cc.lasmgratel.foodcraftreloaded.minecraft.api.recipe.RecipeInput in project FoodCraft-Reloaded by LasmGratel.
the class DrinkMachineTest method testRecipeIngredients.
@Test
public void testRecipeIngredients() {
// Add null -> null recipe
RecipeManager.getInstance().addRecipe(new DrinkRecipe(null, null));
// Should be null recipe
DrinkRecipe recipe = RecipeManager.getInstance().getRecipeNullable(DrinkRecipe.class, new RecipeInput((Item) null));
// Should be presented
Assert.assertNotNull(recipe);
// Null input
Assert.assertNull(recipe.getInput().first());
// Null output
Assert.assertNull(recipe.getOutput().first());
}
use of cc.lasmgratel.foodcraftreloaded.minecraft.api.recipe.RecipeInput in project FoodCraft-Reloaded by LasmGratel.
the class TileEntitySmeltingDrinkMachine method startProgress.
@Override
public void startProgress() {
DrinkRecipe recipe = RecipeManager.getInstance().getRecipeNullable(DrinkRecipe.class, new RecipeInput(itemStackHandler.getStackInSlot(0).getItem()));
if (recipe != null) {
FoodCraftReloaded.getLogger().debug("Smelting drink machine: Found recipe " + recipe.getOutput().<FluidStack>first().getFluid().getName());
fluidOutput = recipe.getOutput().first();
output = recipe.getOutput().second();
itemStackHandler.getStackInSlot(0).splitStack(1);
}
}
Aggregations