Java Code Examples for net.minecraft.item.crafting.IRecipe#getRecipeOutput()

The following examples show how to use net.minecraft.item.crafting.IRecipe#getRecipeOutput() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PLRecipes.java    From Production-Line with MIT License 5 votes vote down vote up
/**
 * Disable recipes.
 *
 * @param itemStack Disable all recipes of this item.
 */
@SuppressWarnings("unchecked")
public static void disableRecipes(ItemStack itemStack) {
    List<IRecipe> recipeList = CraftingManager.getInstance().getRecipeList();
    for (int i = 0; i < recipeList.size(); i++) {
        IRecipe iRecipe = recipeList.get(i);
        ItemStack recipesResult = iRecipe.getRecipeOutput();
        if (ItemStack.areItemStacksEqual(itemStack, recipesResult)) {
            recipeList.remove(i--);
        }
    }
}
 
Example 2
Source File: RecipeUtils.java    From OpenModsLib with MIT License 5 votes vote down vote up
public static IRecipe getFirstRecipeForItemStack(@Nonnull ItemStack resultingItem) {

		for (IRecipe recipe : CraftingManager.REGISTRY) {
			if (recipe == null) continue;

			ItemStack result = recipe.getRecipeOutput();
			if (!result.isEmpty() && result.isItemEqual(resultingItem)) return recipe;

		}
		return null;
	}
 
Example 3
Source File: ResearchPage.java    From AdvancedMod with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @param recipe a vanilla crafting recipe.
 */
public ResearchPage(IRecipe recipe) {
	this.type = PageType.NORMAL_CRAFTING;
	this.recipe = recipe;
	this.recipeOutput = recipe.getRecipeOutput();
}
 
Example 4
Source File: ResearchPage.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @param recipe a vanilla crafting recipe.
 */
public ResearchPage(IRecipe recipe) {
	this.type = PageType.NORMAL_CRAFTING;
	this.recipe = recipe;
	this.recipeOutput = recipe.getRecipeOutput();
}
 
Example 5
Source File: ResearchPage.java    From GardenCollection with MIT License 4 votes vote down vote up
/**
 * @param recipe a vanilla crafting recipe.
 */
public ResearchPage(IRecipe recipe) {
	this.type = PageType.NORMAL_CRAFTING;
	this.recipe = recipe;
	this.recipeOutput = recipe.getRecipeOutput();
}
 
Example 6
Source File: ResearchPage.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 4 votes vote down vote up
/**
 * @param recipe a vanilla crafting recipe.
 */
public ResearchPage(IRecipe recipe) {
	this.type = PageType.NORMAL_CRAFTING;
	this.recipe = recipe;
	this.recipeOutput = recipe.getRecipeOutput();
}
 
Example 7
Source File: ResearchPage.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @param recipe a vanilla crafting recipe.
 */
public ResearchPage(IRecipe recipe) {
	this.type = PageType.NORMAL_CRAFTING;
	this.recipe = recipe;
	this.recipeOutput = recipe.getRecipeOutput();
}