Minor tweaks

This commit is contained in:
Evert Prants 2018-07-28 19:28:43 +03:00
parent 759ec65d8b
commit 1756ce7afd
No known key found for this signature in database
GPG Key ID: 1688DA83D222D0B5
3 changed files with 17 additions and 18 deletions

@ -417,12 +417,7 @@ local function on_construct(pos)
inv:set_size('bucket_in', 1)
inv:set_size('bucket_out', 1)
-- Fluid buffers
meta:set_int('water_fluid_storage', 0)
meta:set_int('metal_fluid_storage', 0)
-- Metal source block
meta:set_string('metal_fluid', '')
-- Water source block
meta:set_string('water_fluid', 'default:water_source')
-- Default infotext

@ -18,10 +18,14 @@ end
local autofind = {"ingot", "lump", "crystal", "ore", "block"}
local modfind = {"default", "technic", "moreores", "elepower_dynamics"}
for metal,_ in pairs(fluidity.molten_metals) do
for i,v in pairs(modfind) do
for j,k in pairs(autofind) do
local name = v..":"..metal.."_"..k
function metal_melter.auto_detect_metal_forms(metal, mod)
if mod then
local modfind = { [0] = mod }
end
for i, v in pairs(modfind) do
for j, k in pairs(autofind) do
local name = v .. ":" .. metal .. "_" .. k
if minetest.registered_items[name] then
metal_melter.register_melt(name, metal, k)
@ -30,6 +34,10 @@ for metal,_ in pairs(fluidity.molten_metals) do
end
end
for metal,_ in pairs(fluidity.molten_metals) do
metal_melter.auto_detect_metal_forms(metal)
end
-- Manually register default blocks, for now
metal_melter.register_melt("default:mese", "mese", "block")
metal_melter.register_melt("default:obsidian", "obsidian", "block")

@ -178,7 +178,8 @@ local function melter_node_timer(pos, elapsed)
-- Handle input bucket, only allow a molten metal
local bucket_in = inv:get_stack("bucket_in", 1)
local bucket_name = bucket_in:get_name()
if (bucket_name:find("bucket") and bucket_name ~= "bucket:bucket_empty") or (not fluidity.florbs.get_is_empty_florb(bucket_in) and fluidity.florbs.get_is_florb(bucket_in)) then
if (bucket_name:find("bucket") and bucket_name ~= "bucket:bucket_empty") or (not fluidity.florbs.get_is_empty_florb(bucket_in) and
fluidity.florbs.get_is_florb(bucket_in)) then
local is_florb = fluidity.florbs.get_is_florb(bucket_in)
if is_florb then
local contents, fluid_name, capacity = fluidity.florbs.get_florb_contents(bucket_in)
@ -328,13 +329,8 @@ local function on_construct(pos)
inv:set_size('bucket_in', 1)
inv:set_size('bucket_out', 1)
-- Fluid buffers
meta:set_int('lava_fluid_storage', 0)
meta:set_int('metal_fluid_storage', 0)
-- Metal source block
meta:set_string('metal_fluid', '')
meta:set_string('lava_fluid', 'default:lava_source')
-- Lava source block
meta:set_string('lava_fluid', 'default:lava_source')
-- Default infotext
meta:set_string("infotext", "Metal Melter Inactive")