diff --git a/aliases.lua b/aliases.lua index ad6fe35..df820c3 100644 --- a/aliases.lua +++ b/aliases.lua @@ -17,8 +17,8 @@ minetest.register_alias("moreblocks:junglewood", "default:junglewood") minetest.register_alias("moreblocks:jungle_wood", "default:junglewood") for _, t in pairs(circular_saw.names) do - minetest.register_alias("moreblocks:"..t[1].."_jungle_wood"..t[2], - "moreblocks:"..t[1].."_junglewood"..t[2]) + minetest.register_alias("moreblocks:" ..t[1].. "_jungle_wood" ..t[2], + "moreblocks:" ..t[1].. "_junglewood" ..t[2]) end minetest.register_alias("moreblocks:horizontaltree", "moreblocks:horizontal_tree") minetest.register_alias("moreblocks:horizontaljungletree", "moreblocks:horizontal_jungle_tree") diff --git a/circular_saw.lua b/circular_saw.lua index 47c1a8c..c8dc2ad 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -5,7 +5,7 @@ circular_saw.known_stairs = setmetatable({}, { __newindex = function(k, v) local modname = minetest.get_current_modname() print(("WARNING: mod %s tried to add node %s to the circular saw" - .." manually."):format(modname, v)) + .. " manually."):format(modname, v)) end, }) @@ -127,7 +127,7 @@ function circular_saw:update_inventory(pos, amount) local material = name_parts[2] inv:set_list("input", { -- Display as many full blocks as possible: - node_name.." ".. math.floor(amount / 8) + node_name.. " " .. math.floor(amount / 8) }) -- The stairnodes made of default nodes use moreblocks namespace, other mods keep own: @@ -269,16 +269,16 @@ gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]" function circular_saw.on_construct(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec", "size[11,9]"..gui_slots.. - "label[0,0;"..S("Input\nmaterial").."]".. - "list[current_name;input;1.5,0;1,1;]".. - "label[0,1;"..S("Left-over").."]".. - "list[current_name;micro;1.5,1;1,1;]".. - "label[0,2;"..S("Recycle\noutput").."]".. - "list[current_name;recycle;1.5,2;1,1;]".. - "field[0.3,3.5;1,1;max_offered;"..S("Max")..":;${max_offered}]".. - "button[1,3.2;1,1;Set;"..S("Set").."]".. - "list[current_name;output;2.8,0;8,4;]".. + meta:set_string("formspec", "size[11,9]" ..gui_slots.. + "label[0,0;" ..S("Input\nmaterial").. "]" .. + "list[current_name;input;1.5,0;1,1;]" .. + "label[0,1;" ..S("Left-over").. "]" .. + "list[current_name;micro;1.5,1;1,1;]" .. + "label[0,2;" ..S("Recycle\noutput").. "]" .. + "list[current_name;recycle;1.5,2;1,1;]" .. + "field[0.3,3.5;1,1;max_offered;" ..S("Max").. ":;${max_offered}]" .. + "button[1,3.2;1,1;Set;" ..S("Set").. "]" .. + "list[current_name;output;2.8,0;8,4;]" .. "list[current_player;main;1.5,5;8,4;]") meta:set_int("anz", 0) -- No microblocks inside yet. diff --git a/nodes.lua b/nodes.lua index 1d7f64e..5efda8f 100644 --- a/nodes.lua +++ b/nodes.lua @@ -6,8 +6,8 @@ local sound_glass = default.node_sound_glass_defaults() local sound_leaves = default.node_sound_leaves_defaults() local function tile_tiles(name) - local tex = "moreblocks_"..name..".png" - return {tex, tex, tex, tex, tex.."^[transformR90", tex.."^[transformR90"} + local tex = "moreblocks_" ..name.. ".png" + return {tex, tex, tex, tex, tex.. "^[transformR90", tex.. "^[transformR90"} end local nodes = { @@ -306,13 +306,13 @@ local nodes = { } for name, def in pairs(nodes) do - def.tiles = def.tiles or {"moreblocks_"..name..".png"} - minetest.register_node("moreblocks:"..name, def) - minetest.register_alias(name, "moreblocks:"..name) + def.tiles = def.tiles or {"moreblocks_" ..name.. ".png"} + minetest.register_node("moreblocks:" ..name, def) + minetest.register_alias(name, "moreblocks:" ..name) if not def.no_stairs then local groups = {} for k, v in pairs(def.groups) do groups[k] = v end - stairsplus:register_all("moreblocks", name, "moreblocks:"..name, { + stairsplus:register_all("moreblocks", name, "moreblocks:" ..name, { description = def.description, groups = groups, tiles = def.tiles, diff --git a/redefinitions.lua b/redefinitions.lua index 304f0ae..d97f7d1 100644 --- a/redefinitions.lua +++ b/redefinitions.lua @@ -94,7 +94,7 @@ minetest.override_item("default:grass_1", { }) for i = 2, 5 do - minetest.override_item("default:grass_"..i, { + minetest.override_item("default:grass_" ..i, { paramtype = "light", sunlight_propagates = true, }) diff --git a/stairsplus/aliases.lua b/stairsplus/aliases.lua index 747a1c3..c92df48 100644 --- a/stairsplus/aliases.lua +++ b/stairsplus/aliases.lua @@ -1,34 +1,34 @@ local function register_stairsplus_alias(modname, origname, newname) - minetest.register_alias(modname..":slab_"..origname, "moreblocks:slab_"..newname) - minetest.register_alias(modname..":slab_"..origname.."_inverted", "moreblocks:slab_"..newname.."_inverted") - minetest.register_alias(modname..":slab_"..origname.."_wall", "moreblocks:slab_"..newname.."_wall") - minetest.register_alias(modname..":slab_"..origname.."_quarter", "moreblocks:slab_"..newname.."_quarter") - minetest.register_alias(modname..":slab_"..origname.."_quarter_inverted", "moreblocks:slab_"..newname.."_quarter_inverted") - minetest.register_alias(modname..":slab_"..origname.."_quarter_wall", "moreblocks:slab_"..newname.."_quarter_wall") - minetest.register_alias(modname..":slab_"..origname.."_three_quarter", "moreblocks:slab_"..newname.."_three_quarter") - minetest.register_alias(modname..":slab_"..origname.."_three_quarter_inverted", "moreblocks:slab_"..newname.."_three_quarter_inverted") - minetest.register_alias(modname..":slab_"..origname.."_three_quarter_wall", "moreblocks:slab_"..newname.."_three_quarter_wall") - minetest.register_alias(modname..":stair_"..origname, "moreblocks:stair_"..newname) - minetest.register_alias(modname..":stair_"..origname.."_inverted", "moreblocks:stair_"..newname.."_inverted") - minetest.register_alias(modname..":stair_"..origname.."_wall", "moreblocks:stair_"..newname.."_wall") - minetest.register_alias(modname..":stair_"..origname.."_wall_half", "moreblocks:stair_"..newname.."_wall_half") - minetest.register_alias(modname..":stair_"..origname.."_wall_half_inverted", "moreblocks:stair_"..newname.."_wall_half_inverted") - minetest.register_alias(modname..":stair_"..origname.."_half", "moreblocks:stair_"..newname.."_half") - minetest.register_alias(modname..":stair_"..origname.."_half_inverted", "moreblocks:stair_"..newname.."_half_inverted") - minetest.register_alias(modname..":stair_"..origname.."_right_half", "moreblocks:stair_"..newname.."_right_half") - minetest.register_alias(modname..":stair_"..origname.."_right_half_inverted", "moreblocks:stair_"..newname.."_right_half_inverted") - minetest.register_alias(modname..":stair_"..origname.."_wall_half", "moreblocks:stair_"..newname.."_wall_half") - minetest.register_alias(modname..":stair_"..origname.."_wall_half_inverted", "moreblocks:stair_"..newname.."_wall_half_inverted") - minetest.register_alias(modname..":stair_"..origname.."_inner", "moreblocks:stair_"..newname.."_inner") - minetest.register_alias(modname..":stair_"..origname.."_inner_inverted", "moreblocks:stair_"..newname.."_inner_inverted") - minetest.register_alias(modname..":stair_"..origname.."_outer", "moreblocks:stair_"..newname.."_outer") - minetest.register_alias(modname..":stair_"..origname.."_outer_inverted", "moreblocks:stair_"..newname.."_outer_inverted") - minetest.register_alias(modname..":panel_"..origname.."_bottom", "moreblocks:panel_"..newname.."_bottom") - minetest.register_alias(modname..":panel_"..origname.."_top", "moreblocks:panel_"..newname.."_top") - minetest.register_alias(modname..":panel_"..origname.."_vertical", "moreblocks:panel_"..newname.."_vertical") - minetest.register_alias(modname..":micro_"..origname.."_bottom", "moreblocks:micro_"..newname.."_bottom") - minetest.register_alias(modname..":micro_"..origname.."_top", "moreblocks:micro_"..newname.."_top") + minetest.register_alias(modname.. ":slab_" ..origname, "moreblocks:slab_" ..newname) + minetest.register_alias(modname.. ":slab_" ..origname.. "_inverted", "moreblocks:slab_" ..newname.. "_inverted") + minetest.register_alias(modname.. ":slab_" ..origname.. "_wall", "moreblocks:slab_" ..newname.. "_wall") + minetest.register_alias(modname.. ":slab_" ..origname.. "_quarter", "moreblocks:slab_" ..newname.. "_quarter") + minetest.register_alias(modname.. ":slab_" ..origname.. "_quarter_inverted", "moreblocks:slab_" ..newname.. "_quarter_inverted") + minetest.register_alias(modname.. ":slab_" ..origname.. "_quarter_wall", "moreblocks:slab_" ..newname.. "_quarter_wall") + minetest.register_alias(modname.. ":slab_" ..origname.. "_three_quarter", "moreblocks:slab_" ..newname.. "_three_quarter") + minetest.register_alias(modname.. ":slab_" ..origname.. "_three_quarter_inverted", "moreblocks:slab_" ..newname.. "_three_quarter_inverted") + minetest.register_alias(modname.. ":slab_" ..origname.. "_three_quarter_wall", "moreblocks:slab_" ..newname.. "_three_quarter_wall") + minetest.register_alias(modname.. ":stair_" ..origname, "moreblocks:stair_" ..newname) + minetest.register_alias(modname.. ":stair_" ..origname.. "_inverted", "moreblocks:stair_" ..newname.. "_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_wall", "moreblocks:stair_" ..newname.. "_wall") + minetest.register_alias(modname.. ":stair_" ..origname.. "_wall_half", "moreblocks:stair_" ..newname.. "_wall_half") + minetest.register_alias(modname.. ":stair_" ..origname.. "_wall_half_inverted", "moreblocks:stair_" ..newname.. "_wall_half_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_half", "moreblocks:stair_" ..newname.. "_half") + minetest.register_alias(modname.. ":stair_" ..origname.. "_half_inverted", "moreblocks:stair_" ..newname.. "_half_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_right_half", "moreblocks:stair_" ..newname.. "_right_half") + minetest.register_alias(modname.. ":stair_" ..origname.. "_right_half_inverted", "moreblocks:stair_" ..newname.. "_right_half_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_wall_half", "moreblocks:stair_" ..newname.. "_wall_half") + minetest.register_alias(modname.. ":stair_" ..origname.. "_wall_half_inverted", "moreblocks:stair_" ..newname.. "_wall_half_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_inner", "moreblocks:stair_" ..newname.. "_inner") + minetest.register_alias(modname.. ":stair_" ..origname.. "_inner_inverted", "moreblocks:stair_" ..newname.. "_inner_inverted") + minetest.register_alias(modname.. ":stair_" ..origname.. "_outer", "moreblocks:stair_" ..newname.. "_outer") + minetest.register_alias(modname.. ":stair_" ..origname.. "_outer_inverted", "moreblocks:stair_" ..newname.. "_outer_inverted") + minetest.register_alias(modname.. ":panel_" ..origname.. "_bottom", "moreblocks:panel_" ..newname.. "_bottom") + minetest.register_alias(modname.. ":panel_" ..origname.. "_top", "moreblocks:panel_" ..newname.. "_top") + minetest.register_alias(modname.. ":panel_" ..origname.. "_vertical", "moreblocks:panel_" ..newname.. "_vertical") + minetest.register_alias(modname.. ":micro_" ..origname.. "_bottom", "moreblocks:micro_" ..newname.. "_bottom") + minetest.register_alias(modname.. ":micro_" ..origname.. "_top", "moreblocks:micro_" ..newname.. "_top") end register_stairsplus_alias("stairsplus", "stone", "stone") diff --git a/stairsplus/conversion.lua b/stairsplus/conversion.lua index d3f7988..fda30c7 100644 --- a/stairsplus/conversion.lua +++ b/stairsplus/conversion.lua @@ -10,26 +10,26 @@ function stairsplus:register_6dfacedir_conversion(modname, material) --print('ABM for '..modname..' "'..material..'"') local objects_list1 = { - modname..":slab_"..material.."_inverted", - modname..":slab_"..material.."_quarter_inverted", - modname..":slab_"..material.."_three_quarter_inverted", - modname..":stair_"..material.."_inverted", - modname..":stair_"..material.."_wall", - modname..":stair_"..material.."_wall_half", - modname..":stair_"..material.."_wall_half_inverted", - modname..":stair_"..material.."_half_inverted", - modname..":stair_"..material.."_right_half_inverted", - modname..":panel_"..material.."_vertical", - modname..":panel_"..material.."_top", + modname.. ":slab_" ..material.. "_inverted", + modname.. ":slab_" ..material.. "_quarter_inverted", + modname.. ":slab_" ..material.. "_three_quarter_inverted", + modname.. ":stair_" ..material.. "_inverted", + modname.. ":stair_" ..material.. "_wall", + modname.. ":stair_" ..material.. "_wall_half", + modname.. ":stair_" ..material.. "_wall_half_inverted", + modname.. ":stair_" ..material.. "_half_inverted", + modname.. ":stair_" ..material.. "_right_half_inverted", + modname.. ":panel_" ..material.. "_vertical", + modname.. ":panel_" ..material.. "_top", } local objects_list2 = { - modname..":slab_"..material.."_wall", - modname..":slab_"..material.."_quarter_wall", - modname..":slab_"..material.."_three_quarter_wall", - modname..":stair_"..material.."_inner_inverted", - modname..":stair_"..material.."_outer_inverted", - modname..":micro_"..material.."_top" + modname.. ":slab_" ..material.. "_wall", + modname.. ":slab_" ..material.. "_quarter_wall", + modname.. ":slab_" ..material.. "_three_quarter_wall", + modname.. ":stair_" ..material.. "_inner_inverted", + modname.. ":stair_" ..material.. "_outer_inverted", + modname.. ":micro_" ..material.. "_top" } for _, object in pairs(objects_list1) do @@ -64,8 +64,8 @@ function stairsplus:register_6dfacedir_conversion(modname, material) dest_object = string.gsub(dest_object, "_right_half", "_half") end - --print(" +---> convert "..object) - --print(" | to "..dest_object) + --print(" +---> convert " ..object) + --print(" | to " ..dest_object) minetest.register_abm({ nodenames = {object}, @@ -107,8 +107,8 @@ function stairsplus:register_6dfacedir_conversion(modname, material) dest_object = string.gsub(dest_object, "_wall", "") end - --print(" +---> convert "..object) - --print(" | to "..dest_object) + --print(" +---> convert " ..object) + --print(" | to " ..dest_object) minetest.register_abm({ nodenames = {object}, diff --git a/stairsplus/init.lua b/stairsplus/init.lua index 4ea710f..cceee2a 100644 --- a/stairsplus/init.lua +++ b/stairsplus/init.lua @@ -1,6 +1,6 @@ -- Nodes will be called :{stair,slab,panel,micro}_ -local modpath = minetest.get_modpath("moreblocks").."/stairsplus" +local modpath = minetest.get_modpath("moreblocks").. "/stairsplus" stairsplus = {} stairsplus.expect_infinite_stacks = false @@ -34,10 +34,10 @@ function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, i }) end --- dofile(modpath.."/aliases.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. --- dofile(modpath.."/conversion.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. -dofile(modpath.."/stairs.lua") -dofile(modpath.."/slabs.lua") -dofile(modpath.."/panels.lua") -dofile(modpath.."/microblocks.lua") -dofile(modpath.."/registrations.lua") +-- dofile(modpath.. "/aliases.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. +-- dofile(modpath.. "/conversion.lua") -- Not needed as of Q2 2013, uncomment to fix old maps. +dofile(modpath.. "/stairs.lua") +dofile(modpath.. "/slabs.lua") +dofile(modpath.. "/panels.lua") +dofile(modpath.. "/microblocks.lua") +dofile(modpath.. "/registrations.lua") diff --git a/stairsplus/microblocks.lua b/stairsplus/microblocks.lua index 6774848..9ef7533 100644 --- a/stairsplus/microblocks.lua +++ b/stairsplus/microblocks.lua @@ -75,28 +75,43 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields) end def.description = desc if fields.drop then - def.drop = modname..":micro_"..fields.drop..alternate + def.drop = modname.. ":micro_" ..fields.drop..alternate end - minetest.register_node(":"..modname..":micro_"..subname..alternate, def) + minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def) end - minetest.register_alias(modname..":micro_"..subname.."_bottom", modname..":micro_"..subname) + minetest.register_alias(modname.. ":micro_" ..subname.. "_bottom", modname.. ":micro_" ..subname) -- Some saw-less recipes: + minetest.register_craft({ + type = "shapeless", + output = "moreblocks:micro_" .. subname .. " 7", + recipe = {"moreblocks:stair_" .. subname .. "_inner"}, + }) + minetest.register_craft({ output = "moreblocks:micro_" .. subname .. " 6", - recipe = {{"moreblocks:stair_" .. subname}}, + type = "shapeless", + recipe = {"moreblocks:stair_" .. subname}, }) minetest.register_craft({ - output = "moreblocks:micro_" .. subname .. " 4", - recipe = {{"moreblocks:slab_" .. subname}}, + type = "shapeless", + output = "moreblocks:micro_" .. subname .. " 5", + recipe = {"moreblocks:stair_" .. subname .. "_outer"}, }) minetest.register_craft({ - output = "moreblocks:micro_" .. subname .. " 2", - recipe = {{"moreblocks:panel_" .. subname}}, + type = "shapeless", + output = "moreblocks:micro_" .. subname .. " 4", + recipe = {"moreblocks:slab_" .. subname}, + }) + + minetest.register_craft({ + type = "shapeless", + output = "moreblocks:micro_" .. subname .. " 2", + recipe = {"moreblocks:panel_" .. subname}, }) minetest.register_craft({ diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua index e6f8871..bbf785c 100644 --- a/stairsplus/panels.lua +++ b/stairsplus/panels.lua @@ -75,11 +75,11 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields) end def.description = desc if fields.drop then - def.drop = modname..":panel_"..fields.drop..alternate + def.drop = modname.. ":panel_" ..fields.drop..alternate end - minetest.register_node(":"..modname..":panel_"..subname..alternate, def) + minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def) end - minetest.register_alias(modname..":panel_"..subname.."_bottom", modname..":panel_"..subname) + minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname) -- Some saw-less recipes: diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua index 1e9b097..ae15c40 100644 --- a/stairsplus/slabs.lua +++ b/stairsplus/slabs.lua @@ -74,11 +74,11 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) end def.description = desc if fields.drop then - def.drop = modname..":slab_"..fields.drop..alternate + def.drop = modname.. ":slab_" ..fields.drop..alternate end - minetest.register_node(":"..modname..":slab_"..subname..alternate, def) + minetest.register_node(":" ..modname.. ":slab_" ..subname..alternate, def) end - minetest.register_alias("stairs:slab_"..subname, modname..":slab_"..subname) + minetest.register_alias("stairs:slab_" ..subname, modname.. ":slab_" ..subname) -- Some saw-less recipes: @@ -94,9 +94,16 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields) }) minetest.register_craft({ - type = "shapeless", output = "moreblocks:slab_" .. subname, - recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname}, + recipe = {{"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname}}, + }) + + minetest.register_craft({ + output = "moreblocks:slab_" .. subname, + recipe = { + {"moreblocks:panel_" .. subname}, + {"moreblocks:panel_" .. subname}, + }, }) minetest.register_craft({ diff --git a/stairsplus/stairs.lua b/stairsplus/stairs.lua index e93fdee..ee1e8ec 100644 --- a/stairsplus/stairs.lua +++ b/stairsplus/stairs.lua @@ -115,11 +115,11 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields) end def.description = desc if fields.drop then - def.drop = modname..":stair_"..fields.drop..alternate + def.drop = modname.. ":stair_" ..fields.drop..alternate end - minetest.register_node(":"..modname..":stair_"..subname..alternate, def) + minetest.register_node(":" ..modname.. ":stair_" ..subname..alternate, def) end - minetest.register_alias(":stairs:stair_"..subname, modname..":stair_"..subname) + minetest.register_alias(":stairs:stair_" ..subname, modname.. ":stair_" ..subname) -- Some saw-less recipes: @@ -206,4 +206,20 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields) output = "moreblocks:stair_" .. subname, recipe = {"moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname, "moreblocks:panel_" .. subname}, }) + + minetest.register_craft({ -- See mirrored variation of the recipe below. + output = "moreblocks:stair_" .. subname .. "_alt", + recipe = { + {"moreblocks:panel_" .. subname, ""}, + {"" , "moreblocks:panel_" .. subname}, + }, + }) + + minetest.register_craft({ -- Mirrored variation of the recipe above. + output = "moreblocks:stair_" .. subname .. "_alt", + recipe = { + {"" , "moreblocks:panel_" .. subname}, + {"moreblocks:panel_" .. subname, ""}, + }, + }) end