Zefram
2014-04-26 f5041784212a5045538983f41e1fc73bf79277a8
technic/machines/register/grinder.lua
@@ -34,12 +34,12 @@
      "list[current_name;src;3,1;1,1;]"..
      "list[current_name;dst;5,1;2,2;]"..
      "list[current_player;main;0,6;8,4;]"..
      "label[0,0;"..tier.." Grinder]"
      "label[0,0;"..S("%s Grinder"):format(tier).."]"
   if data.upgrade then
      formspec = formspec..
         "list[current_name;upgrade1;1,4;1,1;]"..
         "list[current_name;upgrade2;2,4;1,1;]"..
         "label[1,5;Upgrade Slots]"
         "label[1,5;"..S("Upgrade Slots").."]"
   end
   minetest.register_node("technic:"..ltier.."_grinder", {
@@ -76,6 +76,7 @@
          "technic_"..ltier.."_grinder_side.png", "technic_"..ltier.."_grinder_side.png",
          "technic_"..ltier.."_grinder_side.png", "technic_"..ltier.."_grinder_front_active.png"},
      paramtype2 = "facedir",
      drop = "technic:"..ltier.."_grinder",
      groups = active_groups,
      legacy_facedir_simple = true,
      sounds = default.node_sound_wood_defaults(),
@@ -120,7 +121,7 @@
         local result = technic.get_grinder_recipe(inv:get_stack("src", 1))
         if not result then
            hacky_swap_node(pos, machine_node)
            technic.swap_node(pos, machine_node)
            meta:set_string("infotext", S("%s Idle"):format(machine_name))
            meta:set_int(tier.."_EU_demand", 0)
            return
@@ -128,11 +129,11 @@
      
         if eu_input < machine_demand[EU_upgrade+1] then
            -- Unpowered - go idle
            hacky_swap_node(pos, machine_node)
            technic.swap_node(pos, machine_node)
            meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
         elseif eu_input >= machine_demand[EU_upgrade+1] then
            -- Powered   
            hacky_swap_node(pos, machine_node.."_active")
            technic.swap_node(pos, machine_node.."_active")
            meta:set_string("infotext", S("%s Active"):format(machine_name))
            meta:set_int("src_time", meta:get_int("src_time") + 1)