diff --git a/src/main/scala/li/cil/oc/common/Loot.scala b/src/main/scala/li/cil/oc/common/Loot.scala index 96f48fec1..641769c5d 100644 --- a/src/main/scala/li/cil/oc/common/Loot.scala +++ b/src/main/scala/li/cil/oc/common/Loot.scala @@ -117,5 +117,5 @@ object Loot extends WeightedRandomChestContent(new ItemStack(null: Item), 1, 1, if (disks.length > 0) ChestGenHooks.generateStacks(random, disks(random.nextInt(disks.length)), theMinimumChanceToGenerateItem, theMaximumChanceToGenerateItem) - else Array.empty + else Array.empty[ItemStack] } diff --git a/src/main/scala/li/cil/oc/server/component/EEPROM.scala b/src/main/scala/li/cil/oc/server/component/EEPROM.scala index 372415c44..5594d386b 100644 --- a/src/main/scala/li/cil/oc/server/component/EEPROM.scala +++ b/src/main/scala/li/cil/oc/server/component/EEPROM.scala @@ -39,7 +39,7 @@ class EEPROM extends prefab.ManagedEnvironment { if (!node.tryChangeBuffer(-Settings.get.eepromWriteCost)) { return result(Unit, "not enough energy") } - val newData = args.optByteArray(0, Array.empty) + val newData = args.optByteArray(0, Array.empty[Byte]) if (newData.length > Settings.get.eepromSize) throw new IllegalArgumentException("not enough space") codeData = newData context.pause(2) // deliberately slow to discourage use as normal storage medium @@ -85,7 +85,7 @@ class EEPROM extends prefab.ManagedEnvironment { if (!node.tryChangeBuffer(-Settings.get.eepromWriteCost)) { return result(Unit, "not enough energy") } - val newData = args.optByteArray(0, Array.empty) + val newData = args.optByteArray(0, Array.empty[Byte]) if (newData.length > Settings.get.eepromDataSize) throw new IllegalArgumentException("not enough space") volatileData = newData context.pause(1) // deliberately slow to discourage use as normal storage medium diff --git a/src/main/scala/li/cil/oc/util/ItemUtils.scala b/src/main/scala/li/cil/oc/util/ItemUtils.scala index b4534c543..309e8480a 100644 --- a/src/main/scala/li/cil/oc/util/ItemUtils.scala +++ b/src/main/scala/li/cil/oc/util/ItemUtils.scala @@ -55,7 +55,7 @@ object ItemUtils { // we have no way of returning the fluid only (and I can't be arsed // to make it output fluids into fluiducts or such, sorry). !input.getItem.isInstanceOf[ItemBucket]).toArray - def getOutputSize(recipe: IRecipe) = + def getOutputSize(recipe: IRecipe): Double = if (recipe != null && recipe.getRecipeOutput != null) recipe.getRecipeOutput.stackSize else @@ -69,11 +69,11 @@ object ItemUtils { case Some(recipe: ShapelessRecipes) => getFilteredInputs(recipe.recipeItems.map(_.asInstanceOf[ItemStack]), getOutputSize(recipe)) case Some(recipe: ShapedOreRecipe) => getFilteredInputs(resolveOreDictEntries(recipe.getInput), getOutputSize(recipe)) case Some(recipe: ShapelessOreRecipe) => getFilteredInputs(resolveOreDictEntries(recipe.getInput), getOutputSize(recipe)) - case _ => Array.empty + case _ => Array.empty[ItemStack] } // Avoid positive feedback loops. if (ingredients.exists(ingredient => ingredient.isItemEqual(stack))) { - return Array.empty + return Array.empty[ItemStack] } // Merge equal items for size division by output size. val merged = mutable.ArrayBuffer.empty[ItemStack] @@ -98,7 +98,7 @@ object ItemUtils { catch { case t: Throwable => OpenComputers.log.warn("Whoops, something went wrong when trying to figure out an item's parts.", t) - Array.empty + Array.empty[ItemStack] } private lazy val rng = new Random()