use of com.builtbroken.mc.api.recipe.IMachineRecipe in project Engine by VoltzEngine-Project.
the class TestMRHItemStack method testGetRecipe.
public void testGetRecipe() {
RecipeRegisterResult result = handler.registerRecipe(new MRItemStack(MachineRecipeType.ITEM_CRUSHER.INTERNAL_NAME, Blocks.bedrock).addInputOption(Blocks.bedrock));
assertEquals("Failed to register recipe", RecipeRegisterResult.REGISTERED, result);
ItemStack out = handler.getRecipe(new Object[] { new ItemStack(Blocks.bedrock) }, 0, 0);
if (out == null) {
Collection<IMachineRecipe> recipes = handler.getRecipes(new Object[] { new ItemStack(Blocks.bedrock) });
if (recipes == null || recipes.size() == 0) {
recipes = handler.getRecipes();
if (recipes == null || recipes.size() == 0) {
fail("No recipes listed for handler");
}
System.out.println("Recipes Contain: " + handler.recipes.containsKey(handler.getKeyFor(new Object[] { new ItemStack(Blocks.bedrock) })));
for (IMachineRecipe recipe : recipes) {
System.out.println("Machine Recipe: " + recipe + ", Should handler: " + recipe.shouldHandleRecipe(new Object[] { new ItemStack(Blocks.bedrock) }));
}
fail("Not recipes listed for input");
}
for (IMachineRecipe recipe : recipes) {
System.out.println("Machine Recipe: " + recipe + ", Should handler: " + recipe.shouldHandleRecipe(new Object[] { new ItemStack(Blocks.bedrock) }));
}
fail("Output == null");
}
assertTrue("getRecipe should have returned bedrock", out.isItemEqual(new ItemStack(Blocks.bedrock)));
}
Aggregations