Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8

This commit is contained in:
Florian Nücke 2015-05-03 16:14:15 +02:00
commit b1d91ee406
4 changed files with 33 additions and 6 deletions

View File

@ -1,6 +1,6 @@
local package = {}
package.path = "/lib/?.lua;/usr/lib/?.lua;/home/lib/?.lua;./?.lua"
package.path = "/lib/?.lua;/usr/lib/?.lua;/home/lib/?.lua;./?.lua;/lib/?/init.lua;/usr/lib/?/init.lua;/home/lib/?/init.lua;./?/init.lua"
local loading = {}

View File

@ -36,6 +36,15 @@ luaBios {
type: shapeless
input: ["oc:eeprom", "oc:manual"]
}
generic: [
{
result: {block="minecraft:end_stone"}
input: [[enderPearl, sandstone, enderPearl]
[sandstone, blockCoal, sandstone]
[enderPearl, sandstone, enderPearl]]
output: 4
}
]
droneCase1 {
input: [[{block="minecraft:end_stone"}, compass, {block="minecraft:end_stone"}]

View File

@ -139,7 +139,7 @@ object Recipes {
val value = recipes.getValue(name)
value.valueType match {
case ConfigValueType.OBJECT =>
addRecipe(stack, recipes.getConfig(name), "'" + name + "'")
addRecipe(stack, recipes.getConfig(name), s"'$name'")
case ConfigValueType.BOOLEAN =>
// Explicitly disabled, keep in NEI if true.
if (!value.unwrapped.asInstanceOf[Boolean]) {
@ -162,7 +162,7 @@ object Recipes {
for (recipe <- lootRecipes) {
val name = recipe.getString("name")
Loot.builtInDisks.get(name) match {
case Some((stack, _)) => addRecipe(stack, recipe, "loot disk '" + name + "'")
case Some((stack, _)) => addRecipe(stack, recipe, s"loot disk '$name'")
case _ =>
OpenComputers.log.warn(s"Failed adding recipe for loot disk '$name': No such global loot disk.")
hadErrors = true
@ -175,6 +175,24 @@ object Recipes {
hadErrors = true
}
if (recipes.hasPath("generic")) try {
val genericRecipes = recipes.getConfigList("generic")
for (recipe <- genericRecipes) {
val result = recipe.getValue("result").unwrapped()
parseIngredient(result) match {
case stack: ItemStack => addRecipe(stack, recipe, s"'$result'")
case _ =>
OpenComputers.log.warn(s"Failed adding generic recipe for '$result': Invalid output (make sure it's not an OreDictionary name).")
hadErrors = true
}
}
}
catch {
case t: Throwable =>
OpenComputers.log.warn("Failed parsing generic recipes.", t)
hadErrors = true
}
// Recrafting operations.
val navigationUpgrade = api.Items.get(Constants.ItemName.NavigationUpgrade)
val mcu = api.Items.get(Constants.BlockName.Microcontroller)
@ -324,7 +342,7 @@ object Recipes {
def tryGetCount(recipe: Config) = if (recipe.hasPath("output")) recipe.getInt("output") else 1
def parseIngredient(entry: AnyRef) = entry match {
def parseIngredient(entry: AnyRef): AnyRef = entry match {
case map: java.util.Map[AnyRef, AnyRef]@unchecked =>
if (map.contains("oreDict")) {
map.get("oreDict") match {

View File

@ -57,7 +57,7 @@ object DriverController extends DriverTileEntity with EnvironmentAware {
class Environment(tileEntity: AETile) extends ManagedTileEntityEnvironment[AETile](tileEntity, "me_controller") with NamedBlock {
override def preferredName = "me_controller"
override def priority = 0
override def priority = 5
@Callback(doc = "function():table -- Get a list of tables representing the available CPUs in the network.")
def getCpus(context: Context, args: Arguments): Array[AnyRef] =
@ -281,4 +281,4 @@ object DriverController extends DriverTileEntity with EnvironmentAware {
}
}
}
}