mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -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).")
|
else throw new RecipeException("Invalid ingredient type (no oreDict, item or block entry).")
|
||||||
case name: String => getOreNameOrItemStackFromName(name)
|
case name: String =>
|
||||||
case _ => throw new RecipeException("Invalid ingredient type (not a map or string).")
|
|
||||||
}
|
|
||||||
|
|
||||||
private def getOreNameOrItemStackFromName(name: String) =
|
|
||||||
if (name == null || name.trim.isEmpty) null
|
if (name == null || name.trim.isEmpty) null
|
||||||
else if (OreDictionary.getOres(name) != null && !OreDictionary.getOres(name).isEmpty) name
|
else if (OreDictionary.getOres(name) != null && !OreDictionary.getOres(name).isEmpty) name
|
||||||
else {
|
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) =
|
private def itemNameEquals(item: Item, name: String) =
|
||||||
item != null && (item.getUnlocalizedName == name || item.getUnlocalizedName == "item." + name)
|
item != null && (item.getUnlocalizedName == name || item.getUnlocalizedName == "item." + name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user