MCPcopy Create free account
hub / github.com/cuberite/cuberite / GetRecipeFrom

Method GetRecipeFrom

src/FurnaceRecipe.cpp:207–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207const cFurnaceRecipe::Recipe * cFurnaceRecipe::GetRecipeFrom(const cItem & a_Ingredient) const
208{
209 const Recipe * BestRecipe = 0;
210 for (RecipeList::const_iterator itr = m_pState->Recipes.begin(); itr != m_pState->Recipes.end(); ++itr)
211 {
212 const Recipe & R = *itr;
213 if ((R.In->m_ItemType == a_Ingredient.m_ItemType) && (R.In->m_ItemCount <= a_Ingredient.m_ItemCount))
214 {
215 if (BestRecipe && (BestRecipe->In->m_ItemCount > R.In->m_ItemCount))
216 {
217 continue;
218 }
219 else
220 {
221 BestRecipe = &R;
222 }
223 }
224 }
225 return BestRecipe;
226}
227
228
229

Callers 2

UpdateInputMethod · 0.80

Calls 2

beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected