reducing some cost to calling ae getCraftables when no filter is given

this delays calling ae.getItemStack until user code calls it for individual
items. this is vey helpful for servers with huge numbers of craftables
otherwise, all serializing calls happen on the main thread
closes #2964
This commit is contained in:
payonel 2019-11-16 10:17:47 -08:00
parent dd63789b81
commit bfed64fa2d

View File

@ -101,7 +101,7 @@ trait NetworkControl[AETile >: Null <: TileEntity with IGridProxyable with IActi
case (key: String, value: AnyRef) => (key, value)
}
result(allCraftables
.collect{ case aeCraftItem if matches(convert(aeCraftItem), filter) => new NetworkControl.Craftable(tile, aeCraftItem) }
.collect{ case aeCraftItem if filter.isEmpty || matches(convert(aeCraftItem), filter) => new NetworkControl.Craftable(tile, aeCraftItem) }
.toArray)
}