Skip to content

Instantly share code, notes, and snippets.

@ft975
Last active December 19, 2015 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ft975/5992983 to your computer and use it in GitHub Desktop.
Save ft975/5992983 to your computer and use it in GitHub Desktop.
def addRecipe(res: ItemStack, rec: List[String], keyValue: List[(Char, Either[OreDict, Item])]) {
val v: Array[Any] = rec.toArray ++
keyValue.map(
(v) => {
Array[Any](v._1,
v._2 match {
case x: Right[OreDict, Item] => x.right.get
case x: Left[OreDict, Item] => x.left.get
})
}).flatten
GameRegistry.addRecipe(new ShapedOreRecipe(res, v.asInstanceOf[Array[Object]]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment