diff options
-rw-r--r-- | config.lua | 12 | ||||
-rw-r--r-- | init.lua | 16 | ||||
-rw-r--r-- | stairsplus.lua | 2 | ||||
-rw-r--r-- | stairsplus/init.lua | 1 | ||||
-rw-r--r-- | stairsplus_convert.lua | 133 |
5 files changed, 13 insertions, 151 deletions
@@ -1,4 +1,3 @@ - moreblocks.config = {} local function getbool_default(setting, default) @@ -12,19 +11,18 @@ end local function setting(settingtype, name, default) if settingtype == "bool" then moreblocks.config[name] = - getbool_default("moreblocks."..name, default) + getbool_default("moreblocks." .. name, default) else moreblocks.config[name] = - minetest.setting_get("moreblocks."..name) or default + minetest.setting_get("moreblocks." .. name) or default end end --- Whether to direct wood based on player yaw when placing the block (true or false) +-- Whether to direct wood based on player yaw when placing the block (true or false). setting("bool", "wood_facedir", true) --- Allow stair/slab crafting without a circular saw or not (true or false) +-- Allow stair/slab crafting without a circular saw or not (true or false). setting("bool", "allow_stair_slab_crafting", false) --- Show stairs/slabs/panels/microblocks in creative inventory (true or false) +-- Show stairs/slabs/panels/microblocks in creative inventory (true or false). setting("bool", "show_stairsplus_creative_inv", false) - @@ -1,6 +1,6 @@ --[[ -- More Blocks (moreblocks) by Calinou --- Licensed under the zlib/libpng license for code and CC BY-SA for textures, see LICENSE.txt for info. +-- Licensed under the zlib/ license for code and CC BY-SA 3.0 for textures, see LICENSE.txt for info. --]] moreblocks = {} @@ -17,13 +17,13 @@ moreblocks.gettext = S local modpath = minetest.get_modpath("moreblocks") -dofile(modpath.."/config.lua") -dofile(modpath.."/circular_saw.lua") -dofile(modpath.."/stairsplus/init.lua") -dofile(modpath.."/nodes.lua") -dofile(modpath.."/redefinitions.lua") -dofile(modpath.."/crafting.lua") -dofile(modpath.."/aliases.lua") +dofile(modpath .. "/config.lua") +dofile(modpath .. "/circular_saw.lua") +dofile(modpath .. "/stairsplus/init.lua") +dofile(modpath .. "/nodes.lua") +dofile(modpath .. "/redefinitions.lua") +dofile(modpath .. "/crafting.lua") +dofile(modpath .. "/aliases.lua") if minetest.setting_getbool("log_mods") then print(S("[moreblocks] loaded.")) diff --git a/stairsplus.lua b/stairsplus.lua index 3f85902..458a722 100644 --- a/stairsplus.lua +++ b/stairsplus.lua @@ -1,5 +1,3 @@ -dofile(minetest.get_modpath("moreblocks").."/_config.txt") - -- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname> if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then diff --git a/stairsplus/init.lua b/stairsplus/init.lua index 74d7ddb..7cc0385 100644 --- a/stairsplus/init.lua +++ b/stairsplus/init.lua @@ -1,4 +1,3 @@ - -- Nodes will be called <modname>:{stair,slab,panel,micro}_<subname> local modpath = minetest.get_modpath("moreblocks").."/stairsplus" diff --git a/stairsplus_convert.lua b/stairsplus_convert.lua deleted file mode 100644 index 7d6b94b..0000000 --- a/stairsplus_convert.lua +++ /dev/null @@ -1,133 +0,0 @@ --- Function to convert all stairs/slabs/etc nodes from --- inverted, wall, etc to regular + 6d facedir - -local dirs1 = { 21, 20, 23, 22, 21 } -local dirs2 = { 15, 8, 17, 6, 15 } -local dirs3 = { 14, 11, 16, 5, 14 } - -function register_6dfacedir_conversion(modname, material) - --print("Register stairsplus 6d facedir conversion") - --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", - } - - 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" - } - - for j in ipairs(objects_list1) do - local flip_upside_down = false - local flip_to_wall = false - - local object = objects_list1[j] - local dest_object = objects_list1[j] - - if string.find(dest_object, "_inverted") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_inverted", "") - end - - if string.find(dest_object, "_top") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_top", "") - end - - if string.find(dest_object, "_wall") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_wall", "") - end - - if string.find(dest_object, "_vertical") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_vertical", "") - end - - if string.find(dest_object, "_half") and not string.find(dest_object, "_right_half") then - dest_object = string.gsub(dest_object, "_half", "_right_half") - elseif string.find(dest_object, "_right_half") then - dest_object = string.gsub(dest_object, "_right_half", "_half") - end - - --print(" +---> convert "..object) - --print(" | to "..dest_object) - - minetest.register_abm({ - nodenames = { object }, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local fdir = node.param2 or 0 - - if flip_upside_down and not flip_to_wall then - nfdir = dirs1[fdir+2] - elseif flip_to_wall and not flip_upside_down then - nfdir = dirs2[fdir+1] - elseif flip_to_wall and flip_upside_down then - nfdir = dirs3[fdir+2] - end - minetest.env:add_node(pos, {name = dest_object, param2 = nfdir}) - end - }) - end - - for j in ipairs(objects_list2) do - local flip_upside_down = false - local flip_to_wall = false - - local object = objects_list2[j] - local dest_object = objects_list2[j] - - if string.find(dest_object, "_inverted") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_inverted", "") - end - - if string.find(dest_object, "_top") then - flip_upside_down = true - dest_object = string.gsub(dest_object, "_top", "") - end - - if string.find(dest_object, "_wall") then - flip_to_wall = true - dest_object = string.gsub(dest_object, "_wall", "") - end - - --print(" +---> convert "..object) - --print(" | to "..dest_object) - - minetest.register_abm({ - nodenames = { object }, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local fdir = node.param2 - local nfdir = 20 - - if flip_upside_down and not flip_to_wall then - nfdir = dirs1[fdir+1] - elseif flip_to_wall and not flip_upside_down then - nfdir = dirs2[fdir+2] - - end - minetest.env:add_node(pos, {name = dest_object, param2 = nfdir}) - end - }) - end -end |