mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 01:54:46 +00:00
Repackage to team.chisel (excepting API)
This commit is contained in:
1 parent
7555e21144
commit
9574e05c29
132 files changed
+526
-596
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package team.chisel.utils;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Utility for crafting/recipe things
|
||||
*/
|
||||
public class RecipeUtil {
|
||||
|
||||
public static boolean isCraftable(ItemStack stack){
|
||||
for (IRecipe recipe : (List<IRecipe>)CraftingManager.getInstance().getRecipeList()){
|
||||
if (recipe.getRecipeOutput()==null){
|
||||
continue;
|
||||
}
|
||||
if (stack.isItemEqual(recipe.getRecipeOutput())){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSmeltable(ItemStack stack){
|
||||
return FurnaceRecipes.smelting().getSmeltingList().containsKey(stack);
|
||||
}
|
||||
|
||||
public static boolean isCreatable(ItemStack stack){
|
||||
return isCraftable(stack) || isSmeltable(stack);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user