From a75992e164623ff8ab81b80559b86ba125b1ec94 Mon Sep 17 00:00:00 2001 From: payonel Date: Sun, 9 Sep 2018 16:33:48 -0700 Subject: [PATCH] type safe check to remove erasure warning --- .../scala/li/cil/oc/integration/appeng/NetworkControl.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/li/cil/oc/integration/appeng/NetworkControl.scala b/src/main/scala/li/cil/oc/integration/appeng/NetworkControl.scala index b7cdc5118..a808a3cb2 100644 --- a/src/main/scala/li/cil/oc/integration/appeng/NetworkControl.scala +++ b/src/main/scala/li/cil/oc/integration/appeng/NetworkControl.scala @@ -63,10 +63,11 @@ trait NetworkControl[AETile >: Null <: TileEntity with IGridProxyable with IActi private def allCraftables: Iterable[IAEItemStack] = allItems.collect{ case aeItem if aeItem.isCraftable => aeCraftItem(aeItem) } private def convert(aeItem: IAEItemStack): java.util.HashMap[String, AnyRef] = { + case class StringAnyRefHash (value: java.util.HashMap[String, AnyRef]) val potentialItem = aePotentialItem(aeItem) val result = Registry .convert(Array[AnyRef](potentialItem.getItemStack)) - .collect { case hash: java.util.HashMap[String, AnyRef] => hash } + .collect { case StringAnyRefHash(hash) => hash } if (result.length > 0) { val hash = result(0) // it would have been nice to put these fields in a registry convert