compat fix when other mods are NOT installed (#156)

This commit is contained in:
yangbowen 2025-08-28 17:33:55 +00:00 committed by GitHub
parent 69612aa09f
commit e74efbafab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -403,8 +403,10 @@ object ModOpenComputers extends ModProxy {
}
private def blacklistHost(host: Class[_], itemNames: String*) {
for (itemName <- itemNames) {
api.IMC.blacklistHost(itemName, host, api.Items.get(itemName).createItemStack(1))
for (itemName <- itemNames) api.Items.get(itemName) match {
case null => null
case itemInfo: ItemInfo => api.IMC.blacklistHost(itemName, host, itemInfo.createItemStack(1))
case _ => null
}
}