From 6051230af4701bc6ddbfd49000707294c2adca43 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 7 Nov 2023 10:48:23 +0100 Subject: [PATCH] Initial commit --- .editorconfig | 9 +++++++++ README.md | 6 ++++++ init.lua | 37 +++++++++++++++++++++++++++++++++++++ mod.conf | 5 +++++ 4 files changed, 57 insertions(+) create mode 100755 .editorconfig create mode 100644 README.md create mode 100644 init.lua create mode 100755 mod.conf diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 0000000..09e5417 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +indent_style = space +indent_size = 4 + +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/README.md b/README.md new file mode 100644 index 0000000..137eaa5 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# NodeCore Heresy + +In a move most disrespectful towards the creator of award-winning game +[NodeCore], the **Heresy** mod brings the blasphemous concept of nodes that +aren't full 1m³ cubes such as stairs and slabs to the minimalist and pure +experience. (Even though NodeCore has stuff like ladders and frames.) diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..563f833 --- /dev/null +++ b/init.lua @@ -0,0 +1,37 @@ +local minetest, nodecore + = minetest, nodecore + +local MOD_NAME = minetest.get_current_modname() + +local STAIR_NODE_BOX = { + type = "fixed", fixed = { + { -0.5, -0.5, -0.5, 0.5, 0.0, 0.5 }, + { -0.5, 0.0, 0.0, 0.5, 0.5, 0.5 }, + }, +} + +local function do_the_cursed_thing(name, def) + local base_mod_name = name:gsub(":.*", "") + local base_name = name:gsub(".*:", "") + + local stair_name = MOD_NAME .. ":" .. base_mod_name .. "__" .. base_name .. "_stair" + local stair_def = nodecore.underride({ + description = def.description .. " Stair", + + paramtype = "light", + paramtype2 = "facedir", + + drawtype = "nodebox", + node_box = STAIR_NODE_BOX, + selection_box = STAIR_NODE_BOX, + + sunlight_propagates = true, + groups = { stair = 1 }, + }, def) + + minetest.register_node(stair_name, stair_def) +end + +local plank_name = "nc_woodwork:plank" +local plank_def = minetest.registered_nodes[plank_name] +do_the_cursed_thing(plank_name, plank_def) diff --git a/mod.conf b/mod.conf new file mode 100755 index 0000000..f4b02cd --- /dev/null +++ b/mod.conf @@ -0,0 +1,5 @@ +name = nc_heresy +title = NodeCore Heresy +author = copygirl +description = Adds non-full building blocks to NodeCore. +depends = nc_api_all, nc_woodwork