From 3efb796721cf731feab7794c9c4d7792d972bf9f Mon Sep 17 00:00:00 2001 From: Thomas--S Date: Sat, 20 Mar 2021 11:56:41 +0100 Subject: [PATCH] Add kneeling bench --- init.lua | 21 +++++++++++++++++++++ settingtypes.txt | 1 + 2 files changed, 22 insertions(+) diff --git a/init.lua b/init.lua index fc16b83..30702fe 100755 --- a/init.lua +++ b/init.lua @@ -3,6 +3,7 @@ ts_furniture = {} -- If true, you can sit on chairs and benches, when right-click them. ts_furniture.enable_sitting = minetest.settings:get_bool("ts_furniture.enable_sitting", true) ts_furniture.globalstep = minetest.settings:get_bool("ts_furniture.globalstep", true) +ts_furniture.kneeling_bench = minetest.settings:get_bool("ts_furniture.kneeling_bench", false) -- Used for localization local S = minetest.get_translator("ts_furniture") @@ -147,6 +148,26 @@ local furnitures = { } } +if ts_furniture.kneeling_bench then + furnitures.kneeling_bench = { + description = "Kneeling Bench", + nodebox = { + { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }, + { -0.4, -0.5, -0.2, -0.3, -0.3, 0.5 }, + { 0.3, -0.5, -0.2, 0.4, -0.3, 0.5 }, + { -0.5, -0.3, -0.2, 0.5, -0.2, 0.2}, + { -0.5, 0.4, 0.15, 0.5, 0.5, 0.55}, + }, + craft = function(recipe) + local bench_name = "ts_furniture:" .. recipe:gsub(":", "_") .. "_bench" + return { + { recipe, "" }, + { recipe, bench_name } + } + end + } +end + local ignore_groups = { ["wood"] = true, ["stone"] = true diff --git a/settingtypes.txt b/settingtypes.txt index 920f86c..d5c40ed 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1,2 +1,3 @@ ts_furniture.enable_sitting (Enable sitting) bool true ts_furniture.globalstep (Enable globalstep) bool true +ts_furniture.kneeling_bench (Enable kneeling benches) bool false