diff --git a/README.md b/README.md index 2d5d575..aa13bbe 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ Copyright © 2011-2020 Hugo Locurcio and contributors - More Blocks code is licensed under the zlib license, see [`LICENSE.md`](LICENSE.md) for details. +- This is an altered version of the code which is not distributed by Hugo Locurcio. - Unless otherwise specified, More Blocks textures are licensed under [CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/). diff --git a/stairsplus/api/init.lua b/stairsplus/api/init.lua new file mode 100644 index 0000000..12bb6fb --- /dev/null +++ b/stairsplus/api/init.lua @@ -0,0 +1,6 @@ +stairsplus.api = {} + +stairsplus.dofile("api", "shape") +stairsplus.dofile("api", "node") +stairsplus.dofile("api", "station") +stairsplus.dofile("api", "recipe") diff --git a/stairsplus/api/node.lua b/stairsplus/api/node.lua new file mode 100644 index 0000000..1c5c35a --- /dev/null +++ b/stairsplus/api/node.lua @@ -0,0 +1 @@ +-- for registering variants of a specific node diff --git a/stairsplus/api/recipe.lua b/stairsplus/api/recipe.lua new file mode 100644 index 0000000..d963abd --- /dev/null +++ b/stairsplus/api/recipe.lua @@ -0,0 +1,3 @@ +-- for registering recipe schemas +-- should register schemas w/ unified_inventory and i3 and whatever else, +-- and hide the recipes for the individual nodes (possibly a setting for such) diff --git a/stairsplus/api/shape.lua b/stairsplus/api/shape.lua new file mode 100644 index 0000000..fab6777 --- /dev/null +++ b/stairsplus/api/shape.lua @@ -0,0 +1,2 @@ +-- register shapes (e.g. 1/16 slab, 1/8 slab, 1/4 slab, etc) +-- register shape groups (e.g. slab, stair, etc.) diff --git a/stairsplus/api/station.lua b/stairsplus/api/station.lua new file mode 100644 index 0000000..e20f051 --- /dev/null +++ b/stairsplus/api/station.lua @@ -0,0 +1 @@ +-- for creating the circular saw and similar nodes diff --git a/stairsplus/compat/init.lua b/stairsplus/compat/init.lua new file mode 100644 index 0000000..d93f64f --- /dev/null +++ b/stairsplus/compat/init.lua @@ -0,0 +1,3 @@ + +-- unified_inventory, sfinv, i3 + diff --git a/stairsplus/compat/legacy.lua b/stairsplus/compat/legacy.lua new file mode 100644 index 0000000..a4a71c4 --- /dev/null +++ b/stairsplus/compat/legacy.lua @@ -0,0 +1,3 @@ +-- legacy: register all the expected variants for e.g. default, wool, gloopblocks, etc. +-- provide a configuration option to *disable* legacy. it must be enabled by default, to prevent breaking +-- existing servers diff --git a/stairsplus/compat/stairs.lua b/stairsplus/compat/stairs.lua new file mode 100644 index 0000000..cf615e6 --- /dev/null +++ b/stairsplus/compat/stairs.lua @@ -0,0 +1 @@ +-- stairs compat: override what stairs does, and "fix" any stairs which were already registered... diff --git a/stairsplus/crafting.lua b/stairsplus/crafting.lua index aff1e01..29e8c7c 100644 --- a/stairsplus/crafting.lua +++ b/stairsplus/crafting.lua @@ -1,4 +1,4 @@ - +local cm = stairsplus.resources.craft_materials if cm.steel_ingot then if moreblocks.settings.circular_saw_crafting then diff --git a/stairsplus/custom.lua b/stairsplus/custom.lua index 961d1ea..f0b12a6 100644 --- a/stairsplus/custom.lua +++ b/stairsplus/custom.lua @@ -61,7 +61,6 @@ local subset = { } --]] --- luacheck: no unused local function register_custom_subset(subset, modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_custom_subset(subset, modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/init.lua b/stairsplus/init.lua index 0616180..c8b31c5 100644 --- a/stairsplus/init.lua +++ b/stairsplus/init.lua @@ -6,20 +6,40 @@ Licensed under the zlib license. See LICENSE.md for more information. --]] -- Nodes will be called :{stair,slab,panel,micro,slope}_ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +local S = minetest.get_translator(modname) -local modpath = minetest.get_modpath("moreblocks") .. "/stairsplus" +stairsplus = { + version = {3, 0, 0}, + fork = "minetest_mods", -stairsplus = {} -stairsplus.expect_infinite_stacks = false + modname = modname, + modpath = modpath, + + S = S, + + has = { + basic_materials = minetest.get_modpath("basic_materials"), + default = minetest.get_modpath("default"), + gloopblocks = minetest.get_modpath("gloopblocks"), + stairs = minetest.get_modpath("stairs"), + technic = minetest.get_modpath("technic"), + prefab = minetest.get_modpath("prefab"), + wool = minetest.get_modpath("wool"), + }, + + log = function(level, messagefmt, ...) + return minetest.log(level, ("[%s] %s"):format(modname, messagefmt:format(...))) + end, + + dofile = function(...) + return dofile(table.concat({modpath, ...}, DIR_DELIM) .. ".lua") + end, +} stairsplus.shapes_list = {} -if -not minetest.get_modpath("unified_inventory") - and minetest.settings:get_bool("creative_mode") -then - stairsplus.expect_infinite_stacks = true -end function stairsplus:prepare_groups(groups) local result = {} @@ -30,9 +50,11 @@ function stairsplus:prepare_groups(groups) end end end - if not moreblocks.config.stairsplus_in_creative_inventory then + + if not stairsplus.settings.in_creative_inventory then result.not_in_creative_inventory = 1 end + return result end @@ -59,7 +81,6 @@ function stairsplus:register_alias_force_all(modname_old, subname_old, modname_n self:register_micro_alias_force(modname_old, subname_old, modname_new, subname_new) end --- luacheck: no unused local function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_all(modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/locale/stairsplus.de.tr b/stairsplus/locale/stairsplus.de.tr index 69ecbe6..b1e615a 100644 --- a/stairsplus/locale/stairsplus.de.tr +++ b/stairsplus/locale/stairsplus.de.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # German translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.es.tr b/stairsplus/locale/stairsplus.es.tr index af026e3..5c673d1 100644 --- a/stairsplus/locale/stairsplus.es.tr +++ b/stairsplus/locale/stairsplus.es.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # Spanish translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.fr.tr b/stairsplus/locale/stairsplus.fr.tr index 5525884..6e0f0b0 100644 --- a/stairsplus/locale/stairsplus.fr.tr +++ b/stairsplus/locale/stairsplus.fr.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # French translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.it.tr b/stairsplus/locale/stairsplus.it.tr index 47f834c..046b01d 100644 --- a/stairsplus/locale/stairsplus.it.tr +++ b/stairsplus/locale/stairsplus.it.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # Italian translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.pl.tr b/stairsplus/locale/stairsplus.pl.tr index e0de4b4..eb51818 100644 --- a/stairsplus/locale/stairsplus.pl.tr +++ b/stairsplus/locale/stairsplus.pl.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # Polish translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.ru.tr b/stairsplus/locale/stairsplus.ru.tr index c477e47..f8874d8 100644 --- a/stairsplus/locale/stairsplus.ru.tr +++ b/stairsplus/locale/stairsplus.ru.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # Russian translation for MOREBLOCKS minetest mod. # Copyright (C) 2018 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.template.tr b/stairsplus/locale/stairsplus.template.tr index 7dceba4..623a950 100644 --- a/stairsplus/locale/stairsplus.template.tr +++ b/stairsplus/locale/stairsplus.template.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus #: circular_saw.lua diff --git a/stairsplus/locale/stairsplus.zh_CN.tr b/stairsplus/locale/stairsplus.zh_CN.tr index ffab32d..5cceb00 100644 --- a/stairsplus/locale/stairsplus.zh_CN.tr +++ b/stairsplus/locale/stairsplus.zh_CN.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # zh_CN translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/locale/stairsplus.zh_TW.tr b/stairsplus/locale/stairsplus.zh_TW.tr index ddc94cf..824dc07 100644 --- a/stairsplus/locale/stairsplus.zh_TW.tr +++ b/stairsplus/locale/stairsplus.zh_TW.tr @@ -1,4 +1,4 @@ -# textdomain: moreblocks +# textdomain: stairsplus # zh_TW translation for More Blocks. # Copyright © 2011-2020 Hugo Locurcio and contributors diff --git a/stairsplus/microblocks.lua b/stairsplus/microblocks.lua index 88f94fc..1f909c8 100644 --- a/stairsplus/microblocks.lua +++ b/stairsplus/microblocks.lua @@ -7,7 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Node will be called :micro_ --- luacheck: no unused local function register_micro(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_micro(modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/models/moreblocks_slope.obj b/stairsplus/models/stairsplus_slope.obj similarity index 100% rename from stairsplus/models/moreblocks_slope.obj rename to stairsplus/models/stairsplus_slope.obj diff --git a/stairsplus/models/moreblocks_slope_cut.obj b/stairsplus/models/stairsplus_slope_cut.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_cut.obj rename to stairsplus/models/stairsplus_slope_cut.obj diff --git a/stairsplus/models/moreblocks_slope_half.obj b/stairsplus/models/stairsplus_slope_half.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_half.obj rename to stairsplus/models/stairsplus_slope_half.obj diff --git a/stairsplus/models/moreblocks_slope_half_raised.obj b/stairsplus/models/stairsplus_slope_half_raised.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_half_raised.obj rename to stairsplus/models/stairsplus_slope_half_raised.obj diff --git a/stairsplus/models/moreblocks_slope_inner.obj b/stairsplus/models/stairsplus_slope_inner.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner.obj rename to stairsplus/models/stairsplus_slope_inner.obj diff --git a/stairsplus/models/moreblocks_slope_inner_cut.obj b/stairsplus/models/stairsplus_slope_inner_cut.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner_cut.obj rename to stairsplus/models/stairsplus_slope_inner_cut.obj diff --git a/stairsplus/models/moreblocks_slope_inner_cut_half.obj b/stairsplus/models/stairsplus_slope_inner_cut_half.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner_cut_half.obj rename to stairsplus/models/stairsplus_slope_inner_cut_half.obj diff --git a/stairsplus/models/moreblocks_slope_inner_cut_half_raised.obj b/stairsplus/models/stairsplus_slope_inner_cut_half_raised.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner_cut_half_raised.obj rename to stairsplus/models/stairsplus_slope_inner_cut_half_raised.obj diff --git a/stairsplus/models/moreblocks_slope_inner_half.obj b/stairsplus/models/stairsplus_slope_inner_half.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner_half.obj rename to stairsplus/models/stairsplus_slope_inner_half.obj diff --git a/stairsplus/models/moreblocks_slope_inner_half_raised.obj b/stairsplus/models/stairsplus_slope_inner_half_raised.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_inner_half_raised.obj rename to stairsplus/models/stairsplus_slope_inner_half_raised.obj diff --git a/stairsplus/models/moreblocks_slope_outer.obj b/stairsplus/models/stairsplus_slope_outer.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer.obj rename to stairsplus/models/stairsplus_slope_outer.obj diff --git a/stairsplus/models/moreblocks_slope_outer_cut.obj b/stairsplus/models/stairsplus_slope_outer_cut.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer_cut.obj rename to stairsplus/models/stairsplus_slope_outer_cut.obj diff --git a/stairsplus/models/moreblocks_slope_outer_cut_half.obj b/stairsplus/models/stairsplus_slope_outer_cut_half.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer_cut_half.obj rename to stairsplus/models/stairsplus_slope_outer_cut_half.obj diff --git a/stairsplus/models/moreblocks_slope_outer_cut_half_raised.obj b/stairsplus/models/stairsplus_slope_outer_cut_half_raised.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer_cut_half_raised.obj rename to stairsplus/models/stairsplus_slope_outer_cut_half_raised.obj diff --git a/stairsplus/models/moreblocks_slope_outer_half.obj b/stairsplus/models/stairsplus_slope_outer_half.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer_half.obj rename to stairsplus/models/stairsplus_slope_outer_half.obj diff --git a/stairsplus/models/moreblocks_slope_outer_half_raised.obj b/stairsplus/models/stairsplus_slope_outer_half_raised.obj similarity index 100% rename from stairsplus/models/moreblocks_slope_outer_half_raised.obj rename to stairsplus/models/stairsplus_slope_outer_half_raised.obj diff --git a/stairsplus/panels.lua b/stairsplus/panels.lua index 40f3320..ed16574 100644 --- a/stairsplus/panels.lua +++ b/stairsplus/panels.lua @@ -7,7 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Node will be called :panel_ --- luacheck: no unused local function register_panel(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_panel(modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/resources/craft_materials.lua b/stairsplus/resources/craft_materials.lua new file mode 100644 index 0000000..5c3475a --- /dev/null +++ b/stairsplus/resources/craft_materials.lua @@ -0,0 +1,9 @@ +local table_set_all = stairsplus.util.table_set_all + +stairsplus.resources.craft_materials = {} + +if stairsplus.has.default then + table_set_all(stairsplus.resources.craft_materials, { + steel_ingot = "default:steel_ingot", + }) +end diff --git a/stairsplus/resources/init.lua b/stairsplus/resources/init.lua new file mode 100644 index 0000000..8b13d25 --- /dev/null +++ b/stairsplus/resources/init.lua @@ -0,0 +1,4 @@ +stairsplus.resources = {} + +stairsplus.dofile("resources", "craft_materials") +stairsplus.dofile("resources", "sounds") diff --git a/stairsplus/resources/sounds.lua b/stairsplus/resources/sounds.lua new file mode 100644 index 0000000..9b4eaf6 --- /dev/null +++ b/stairsplus/resources/sounds.lua @@ -0,0 +1,9 @@ +local table_set_all = moreblocks.util.table_set_all + +moreblocks.resources.sounds = {} + +if moreblocks.has.default then + table_set_all(moreblocks.resources.sounds, { + wood = default.node_sound_wood_defaults(), + }) +end diff --git a/stairsplus/settings.lua b/stairsplus/settings.lua index f9e32f2..739b317 100644 --- a/stairsplus/settings.lua +++ b/stairsplus/settings.lua @@ -1,4 +1,7 @@ stairsplus.settings = { in_creative_inventory = minetest.settings:get_bool("stairsplus.in_creative_inventory", false), - circular_saw_crafting = minetest.settings:get_bool("stairsplus.circular_saw_crafting", true) + circular_saw_crafting = minetest.settings:get_bool("stairsplus.circular_saw_crafting", true), + expect_infinite_stacks = minetest.settings:get_bool("stairsplus.expect_infinite_stacks", + minetest.settings:get_bool("creative_mode", false) + ) } diff --git a/stairsplus/slabs.lua b/stairsplus/slabs.lua index 520b17d..278539c 100644 --- a/stairsplus/slabs.lua +++ b/stairsplus/slabs.lua @@ -7,7 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Node will be called :slab_ --- luacheck: no unused local function register_slab(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_slab(modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/slopes.lua b/stairsplus/slopes.lua index df3469b..87ff346 100644 --- a/stairsplus/slopes.lua +++ b/stairsplus/slopes.lua @@ -7,7 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Node will be called :slope_ --- luacheck: no unused local function register_slope(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_slope(modname, subname, recipeitem, { groups = groups, diff --git a/stairsplus/stairs.lua b/stairsplus/stairs.lua index a90a026..b1374ca 100644 --- a/stairsplus/stairs.lua +++ b/stairsplus/stairs.lua @@ -7,7 +7,6 @@ Licensed under the zlib license. See LICENSE.md for more information. -- Node will be called :stair_ --- luacheck: no unused local function register_stair(modname, subname, recipeitem, groups, images, description, drop, light) stairsplus:register_stair(modname, subname, recipeitem, { groups = groups, diff --git a/moreblocks/textures/moreblocks_circular_saw_bottom.png b/stairsplus/textures/stairsplus_circular_saw_bottom.png similarity index 100% rename from moreblocks/textures/moreblocks_circular_saw_bottom.png rename to stairsplus/textures/stairsplus_circular_saw_bottom.png diff --git a/moreblocks/textures/moreblocks_circular_saw_side.png b/stairsplus/textures/stairsplus_circular_saw_side.png similarity index 100% rename from moreblocks/textures/moreblocks_circular_saw_side.png rename to stairsplus/textures/stairsplus_circular_saw_side.png diff --git a/moreblocks/textures/moreblocks_circular_saw_top.png b/stairsplus/textures/stairsplus_circular_saw_top.png similarity index 100% rename from moreblocks/textures/moreblocks_circular_saw_top.png rename to stairsplus/textures/stairsplus_circular_saw_top.png