Tim
2015-01-18 00f61dfb81100094b64de06ca4e1ef73ef8bcd47
technic/machines/LV/coal_alloy_furnace.lua
@@ -12,8 +12,18 @@
   }
})
local machine_name = S("Fuel-Fired Alloy Furnace")
local formspec =
   "size[8,9]"..
   "label[0,0;"..machine_name.."]"..
   "image[2,2;1,1;default_furnace_fire_bg.png]"..
   "list[current_name;fuel;2,3;1,1;]"..
   "list[current_name;src;2,1;2,1;]"..
   "list[current_name;dst;5,1;2,2;]"..
   "list[current_player;main;0,5;8,4;]"
minetest.register_node("technic:coal_alloy_furnace", {
   description = S("Fuel-Fired Alloy Furnace"),
   description = machine_name,
   tiles = {"technic_coal_alloy_furnace_top.png",  "technic_coal_alloy_furnace_bottom.png",
            "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
            "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front.png"},
@@ -22,9 +32,9 @@
   legacy_facedir_simple = true,
   sounds = default.node_sound_stone_defaults(),
   on_construct = function(pos)
      local meta = minetest.env:get_meta(pos)
      meta:set_string("formspec", coal_alloy_furnace_formspec)
      meta:set_string("infotext", S("Fuel-Fired Alloy Furnace"))
      local meta = minetest.get_meta(pos)
      meta:set_string("formspec", formspec)
      meta:set_string("infotext", machine_name)
      local inv = meta:get_inventory()
      inv:set_size("fuel", 1)
      inv:set_size("src", 2)
@@ -37,7 +47,7 @@
})
minetest.register_node("technic:coal_alloy_furnace_active", {
   description = S("Fuel-Fired Alloy Furnace"),
   description = machine_name,
   tiles = {"technic_coal_alloy_furnace_top.png",  "technic_coal_alloy_furnace_bottom.png",
            "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_side.png",
            "technic_coal_alloy_furnace_side.png", "technic_coal_alloy_furnace_front_active.png"},
@@ -68,15 +78,6 @@
      end
      
      local recipe = nil
      local machine_name = S("Fuel-Fired Alloy Furnace")
      local formspec =
         "size[8,9]"..
         "label[0,0;"..machine_name.."]"..
         "image[2,2;1,1;default_furnace_fire_bg.png]"..
         "list[current_name;fuel;2,3;1,1;]"..
         "list[current_name;src;2,1;2,1;]"..
         "list[current_name;dst;5,1;2,2;]"..
         "list[current_player;main;0,5;8,4;]"
      for i, name in pairs({
            "fuel_totaltime",
@@ -141,10 +142,11 @@
      -- Next take a hard look at the fuel situation
      local fuel = nil
      local afterfuel
      local fuellist = inv:get_list("fuel")
      if fuellist then
         fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
         fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
      end
      if fuel.time <= 0 then
@@ -157,9 +159,7 @@
      meta:set_string("fuel_totaltime", fuel.time)
      meta:set_string("fuel_time", 0)
      local stack = inv:get_stack("fuel", 1)
      stack:take_item()
      inv:set_stack("fuel", 1, stack)
      inv:set_stack("fuel", 1, afterfuel.items[1])
   end,
})