mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -04:00
inlined getOreNameOrItemStackFromName
This commit is contained in:
parent
76cec04771
commit
98832e18f8
@ -211,11 +211,7 @@ object Recipes {
|
||||
}
|
||||
}
|
||||
else throw new RecipeException("Invalid ingredient type (no oreDict, item or block entry).")
|
||||
case name: String => getOreNameOrItemStackFromName(name)
|
||||
case _ => throw new RecipeException("Invalid ingredient type (not a map or string).")
|
||||
}
|
||||
|
||||
private def getOreNameOrItemStackFromName(name: String) =
|
||||
case name: String =>
|
||||
if (name == null || name.trim.isEmpty) null
|
||||
else if (OreDictionary.getOres(name) != null && !OreDictionary.getOres(name).isEmpty) name
|
||||
else {
|
||||
@ -227,6 +223,8 @@ object Recipes {
|
||||
}
|
||||
}
|
||||
}
|
||||
case _ => throw new RecipeException("Invalid ingredient type (not a map or string).")
|
||||
}
|
||||
|
||||
private def itemNameEquals(item: Item, name: String) =
|
||||
item != null && (item.getUnlocalizedName == name || item.getUnlocalizedName == "item." + name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user