diff --git a/mover.lua b/mover.lua index 4f134d3..aa38992 100644 --- a/mover.lua +++ b/mover.lua @@ -210,11 +210,15 @@ minetest.register_node("basic_machines:mover", { end local node1 = minetest.get_node(pos1);local node2 = minetest.get_node(pos2); + local prefer = meta:get_string("prefer"); --minetest.chat_send_all(" pos1 " .. pos1.x .. " " .. pos1.y .. " " .. pos1.z .. " pos2 " .. pos2.x .. " " .. pos2.y .. " " .. pos2.z ); -- FUEL COST: calculate local dist = math.abs(pos2.x-pos1.x)+math.abs(pos2.y-pos1.y)+math.abs(pos2.z-pos1.z); local fuel_cost = basic_machines.hardness[node1.name] or 1; + + if node1.name == "default:chest_locked" or mode == "inventory" then fuel_cost = basic_machines.hardness[prefer] or 1 end; + fuel_cost=fuel_cost*dist; if mode == "object" then fuel_cost=fuel_cost*0.1; @@ -274,9 +278,6 @@ minetest.register_node("basic_machines:mover", { if fuel < fuel_cost then meta:set_string("infotext", "Mover block. Fuel ".. fuel ..", needed fuel " .. fuel_cost .. ". Put fuel chest near mover or place outlet below it."); return end - - local prefer = meta:get_string("prefer"); - if mode == "object" then -- teleport objects and return diff --git a/recycler.lua b/recycler.lua index 5018f10..3152424 100644 --- a/recycler.lua +++ b/recycler.lua @@ -11,8 +11,6 @@ local recycler_process = function(pos) -- FUEL CHECK local fuel = meta:get_float("fuel"); - - if fuel<=0 then -- we need new fuel, check chest below local fuellist = inv:get_list("fuel") if not fuellist then return end -- safety check, prevents crash when using previous version recylcler without inventory @@ -36,8 +34,8 @@ local recycler_process = function(pos) fuel=fuel + fueladd.time*0.1 meta:set_float("fuel",fuel); meta:set_string("infotext", "added fuel furnace burn time " .. fueladd.time .. ", fuel status " .. fuel); - if fuel<=0 then return end end + if fuel<=0 then return end end @@ -132,7 +130,7 @@ minetest.register_node("basic_machines:recycler", { sounds = default.node_sound_wood_defaults(), after_place_node = function(pos, placer) local meta = minetest.get_meta(pos); - meta:set_string("infotext", "Recycler: put one item in it (src) and obtain 75% of raw materials (dst). To operate it must sit on top of chest with fuel.") + meta:set_string("infotext", "Recycler: put one item in it (src) and obtain 75% of raw materials (dst). To operate it insert fuel, then insert item to recycle or use keypad to activate it.") meta:set_string("owner", placer:get_player_name()); meta:set_int("recipe",1); meta:set_float("fuel",0); diff --git a/to_do.txt b/to_do.txt index e48ce5f..057c56a 100644 --- a/to_do.txt +++ b/to_do.txt @@ -1,2 +1,10 @@ -display source 2 block too ( maybe different mark T for target) -to do: use timer to run the keypad (then turn the timer off when done) +transform distributor into logic element: + +several inputs, +several outputs + +operations: not, or, and or maybe even lua syntax?? +like + +(1 or 2) and 3 where 1,2,3 are inputs +not 1 \ No newline at end of file